|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
AAL1gator-32/-8/-4 Driver User's Manual PM73122, PM73123, PM73124 AAL1GATOR-32/-8/-4 DRIVER USER'S MANUAL PROPRIETARY AND CONFIDENTIAL RELEASE ISSUE 3: AUGUST, 2001 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 AAL1gator-32/-8/-4 Driver User's Manual ABOUT THIS MANUAL AND AAL1GATOR-32/-8/-4 This manual describes the AAL1gator-32/-8/-4 device driver. It describes the driver's functions, data structures, and architecture. This manual focuses on the driver's interfaces to the application code, real-time operating system, and to the AAL1gator-32/-8/-4 device. It also describes in general terms how to modify and port the driver to your software and hardware platform. The AAL1gator-32/-8/-4 Device Driver will support the AAL1gator-32 (PM73122), AAL1gator-8 (PM73123), and AAL1gator-4 (PM73124) devices. The Device Driver identifies which of the three Devices is installed and performs its functions accordingly. In systems with more than one Device, any combination of the three supported Devices is allowed. The abbreviation used in this user's manual for the AAL1gator-32/-8/-4 is `AAL1gator32'. Constants are prefixed with `AL3_' and APIs are prefixed with `al3' (e.g. al3ModuleOpen()). Audience This manual is written for people who need to: * * * Evaluate and test the AAL1gator-32/-8/-4 devices. Modify and add to the AAL1gator-32/-8/-4 driver functions. Port the AAL1gator-32/-8/-4 driver to a particular platform. References For more information about the AAL1gator-32 driver, see the driver's release notes. For more information about the AAL1gator-32, AAL1gator-8, and AAL1gator-4 devices, see the documents listed in the table below and any related errata documents. Table 1: Related Documents Document Number PMC-2000024 PMC-2000088 PMC-1981419 PMC-1991271 Document Name AAL1gator Product Family Technical Overview AAL1gator White Paper (Network Convergence Of Voice, Data And Video) AAL1gator-32 Data Sheet AAL1gator-32 Short Form Data Sheet Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 4 AAL1gator-32/-8/-4 Driver User's Manual Document Number PMC-1990887 PMC-2000097 PMC-1991272 PMC-1991089 PMC-2000095 PMC-1991273 PMC-1991820 Document Name AAL1gator-32 Reference Design AAL1gator-8 Data Sheet AAL1gator-8 Short Form Data Sheet AAL1gator-8 Paper Reference Design AAL1gator-8/-4 Designs Application Note AAL1gator-4 Short Form Data Sheet AAL1gator-32/8/4 Programmer's Guide Note: Ensure that you use the document that PMC-Sierra issued for your version of the device and driver. Revision History Issue No. Issue 1 Issue 2 Issue Date May, 2000 June 2001 Details of Change Document created Idle Channel Detection parameters changed for proper configuration. Interrupt and Deferred Processing vectors changed to reflect new Interrupt processing architecture. Added busMaster and twoC1FPEnable to SBI bus configuration. Added shiftCAS to Line Configuration. Fixed typographical errors. Issue 3 August, 2001 Change Product Status from Preliminary to Release Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 5 AAL1gator-32/-8/-4 Driver User's Manual Legal Issues None of the information contained in this document constitutes an express or implied warranty by PMC-Sierra, Inc. as to the sufficiency, fitness or suitability for a particular purpose of any such information or the fitness, or suitability for a particular purpose, merchantability, performance, compatibility with other parts or systems, of any of the products of PMC-Sierra, Inc., or any portion thereof, referred to in this document. PMC-Sierra, Inc. expressly disclaims all representations and warranties of any kind regarding the contents or use of the information, including, but not limited to, express and implied warranties of accuracy, completeness, merchantability, fitness for a particular use, or non-infringement. In no event will PMC-Sierra, Inc. be liable for any direct, indirect, special, incidental or consequential damages, including, but not limited to, lost profits, lost business or lost data resulting from any use of or reliance upon the information, whether or not PMC-Sierra, Inc. has been advised of the possibility of such damage. The information is proprietary and confidential to PMC-Sierra, Inc., and for its customers' internal use. In any event, you cannot reproduce any part of this document, in any form, without the express written consent of PMC-Sierra, Inc. (c) 2001 PMC-Sierra, Inc. PMC-1991444 (P2), ref PMC-990901 (P1) Contacting PMC-Sierra PMC-Sierra, Inc. 105-8555 Baxter Place Burnaby, BC Canada V5A 4V7 Tel: (604) 415-6000 Fax: (604) 415-6200 Document Information: document@pmc-sierra.com Corporate Information: info@pmc-sierra.com Technical Support: apps@pmc-sierra.com Web Site: http://www.pmc-sierra.com Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 6 AAL1gator-32/-8/-4 Driver User's Manual TABLE OF CONTENTS About this Manual and AAL1gator-32/-8/-4......................................................................... 4 Table of Contents ................................................................................................................ 7 List of Figures.................................................................................................................... 13 List of Tables ..................................................................................................................... 14 1 2 3 Driver Porting Quick Start ........................................................................................... 16 Driver Functions and Features ................................................................................... 17 Software Architecture ................................................................................................. 18 3.1 3.2 Driver Interfaces ............................................................................................... 18 Application Programming Interface .................................................................. 18 Driver API ................................................................................................... 19 Alarms and Statistics .................................................................................. 19 AAL1 Channel Configuration...................................................................... 19 UTOPIA/Any-PHY Configuration................................................................ 20 RAM Configuration ..................................................................................... 20 SBI Bus Configuration ................................................................................ 20 Direct Line Configuration............................................................................ 20 Real Time Operating System............................................................................ 20 Driver Hardware Interface................................................................................. 21 Main Components............................................................................................. 22 Driver Library Module ................................................................................. 23 Device Data-Block Module ......................................................................... 23 Interrupt-Service Routine Module .............................................................. 23 Deferred-Processing Routine Module ........................................................ 24 Software State Description ............................................................................... 25 Module States ................................................................................................... 26 Start ............................................................................................................ 26 Idle 26 Ready ......................................................................................................... 26 Device States .................................................................................................... 26 Start ............................................................................................................ 26 Present ....................................................................................................... 26 Active.......................................................................................................... 27 Inactive ....................................................................................................... 27 Processing Flows.............................................................................................. 27 Module Management ................................................................................. 27 Device Management .................................................................................. 28 3.3 3.4 3.5 3.6 3.7 3.8 3.9 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 7 AAL1gator-32/-8/-4 Driver User's Manual 3.10 Interrupt Servicing............................................................................................. 29 Calling al3ISR............................................................................................. 30 Calling al3DPR ........................................................................................... 30 3.11 Polling 31 3.12 Device Configuration ........................................................................................ 32 AAL1 Channel Configuration...................................................................... 32 UTOPIA/Any-PHY Bus Configuration ........................................................ 33 RAM Interface Configuration...................................................................... 35 SBI Bus Configuration ................................................................................ 35 Direct Line Interface Configuration............................................................. 35 Alarms and Statistics .................................................................................. 36 3.13 Constants .......................................................................................................... 36 3.14 Variables ........................................................................................................... 37 4 Data Structures ........................................................................................................... 39 4.1 Data Structures ................................................................................................. 39 AAL1 Channel Configuration Tables .......................................................... 39 UTOPIA/Any-PHY Bus Configuration Table............................................... 41 RAM Interface Configuration Table ............................................................ 42 SBI Bus Configuration Tables .................................................................... 43 Direct Line Interface Configuration Table ................................................... 44 Structures Passed by the Application ............................................................... 44 Module Initialization Vector ........................................................................ 44 Initialization Profile ..................................................................................... 45 AAL1 Channel Configration Parameters .................................................... 50 Counter Specification ................................................................................. 52 Sticky Bit Error Word .................................................................................. 52 ISR Enable/Disable Mask .......................................................................... 53 Structures in the Driver's Allocated Memory..................................................... 55 Module Data Block ..................................................................................... 55 Device Data Block ...................................................................................... 56 Module Status Block................................................................................... 58 Device Status Block.................................................................................... 58 Structures Passed Through RTOS Buffers....................................................... 59 Interrupt Service Vector.............................................................................. 59 Deferred Processing Vector ....................................................................... 60 4.2 4.3 4.4 5 Application Programming Interface ............................................................................ 61 5.1 Module Initialization .......................................................................................... 61 Opening Modules: al3ModuleOpen............................................................ 61 Closing Modules: al3ModuleClose............................................................. 61 Module Activation.............................................................................................. 62 Starting Modules: al3ModuleStart .............................................................. 62 Stopping Modules: al3ModuleStop............................................................. 62 5.2 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 8 AAL1gator-32/-8/-4 Driver User's Manual 5.3 Profile Management.......................................................................................... 63 Creating Initialization Profiles: al3AddInitProfile ........................................ 63 Getting Initialization Profiles: al3GetInitProfile ........................................... 63 Deleting Initialization Profiles: al3DeleteInitProfile..................................... 63 Device Initialization ........................................................................................... 64 Initializing Devices: al3Init .......................................................................... 64 Resetting Devices: al3Reset ...................................................................... 64 Device Addition and Deletion............................................................................ 65 Adding Devices: al3Add ............................................................................. 65 Deleting Devices: al3Delete ....................................................................... 65 Device Activation and De-Activation................................................................. 66 Activating Devices: al3Activate .................................................................. 66 Deactivating Devices: al3DeActivate ......................................................... 66 Device Reading and Writing ............................................................................. 67 Reading from Devices: al3Read ................................................................ 67 Writing to Devices: al3Write ....................................................................... 67 Reading from Register Blocks: al3ReadBlock ........................................... 68 Writing to Register Blocks: al3WriteBlock .................................................. 68 Reading from Indirect Registers: al3ReadInd ............................................ 69 Writing to Indirect Registers: al3WriteInd................................................... 69 AAL1 Channel Provisioning .............................................................................. 70 Setting Line Modes: al3SetLineMode ........................................................ 70 Configuring Underrun Data: al3SetUnderrun ............................................. 71 Setting Global Clock Configuration: al3GlobalClkConfig ........................... 71 Activating Channels: al3ActivateChannel .................................................. 71 Deactivating Channels: al3DeActivateChannel ......................................... 72 Activating Channels with Enhanced Parameters: al3EnhancedActivateChannel ............................................................. 72 Activating Unstructured Channels: al3ActivateChannelUnstr .................... 73 Activating Unstructured Channels with Enhanced Parameters: al3EnhancedActivateChannelUnstr..................................................... 74 Deactivating Unstructured Channels: al3DeActivateChannelUnstr ........... 74 Activating Structured Channels : al3ActivateChannelStr ........................... 75 Activating Structured Channels With Enhanced Parameters: al3EnhancedActivateChannelStr ......................................................... 75 Deactivating Structured Channels: al3DeActivateChannelStr ................... 76 Associating Channels With An Existing Mapping: al3AssociateChannel .. 76 Disassociating Channels With An Existing Mapping: al3DisAssociateChannel...................................................................... 77 Channel Conditioning ....................................................................................... 77 Enabling Transmit Conditioning: al3EnableTxCond................................... 77 Disabling Transmit Conditioning: al3DisableTxCond ................................. 78 Enabling Receive Conditioning: al3EnableRxCond ................................... 78 Disabling Receive Conditioning: al3DisableRxCond ................................. 79 5.4 5.5 5.6 5.7 5.8 5.9 5.10 SRTS Functions................................................................................................ 79 Enabling SRTS: al3EnableSRTS ............................................................... 79 Disabling SRTS: al3DisableSRTS ............................................................. 79 5.11 Loopback Functions.......................................................................................... 80 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 9 AAL1gator-32/-8/-4 Driver User's Manual Enabling Loopbacks: al3EnableLpbk ......................................................... 80 Disabling Loopbacks: al3DisableLpbk ....................................................... 80 Enabling Utopia Loopbacks: al3UtopiaLpbkEnable ................................... 81 Disabling Utopia Loopbacks: al3UtopiaLpbkDisable ................................. 81 5.12 Idle Detection Functions ................................................................................... 81 Setting Activate Timeslots: al3SetTimeslotActive....................................... 81 Setting Idle Timeslots: al3SetTimeslotIdle ................................................. 82 5.13 OAM Functions ................................................................................................. 82 Transmitting OAM Cells: al3TxOAMcell..................................................... 82 Receiving OAM Cells: al3RxOAMcell ........................................................ 83 5.14 Alarms and Statistics ........................................................................................ 83 Enabling DS3 AIS Cells: al3EnableDS3AISCells....................................... 83 Disabling DS3 AIS Cells: al3DisableDS3AISCells ..................................... 84 Enabling SBI Alarms: al3EnableSBIAlarm ................................................. 84 Disabling SBI Alarms: al3DisableSBIAlarm ............................................... 84 Returning Conditional Cell Count: al3GetTCondCellCount ....................... 85 Returning Suppressed Cell Count: al3GetTSupprCellCount ..................... 85 Returning Tx Cell Count: al3GetTCellCount .............................................. 85 Returning Rx OAM Cell Count: al3GetROAMCellCount............................ 86 Returning Tx OAM Cell Count: al3GetTOAMCellCount............................. 86 Returning Dropped Rx OAM Cell Count: al3GetRDroppedOAMCellCount86 Returning SN Error Count: al3GetRIncorrectSn ........................................ 87 Returning Rx Cell Count With Incorrect SNP: al3GetRIncorrectSnp......... 87 Returning Cell Count: al3GetRCellCount................................................... 87 Returning Dropped Rx Cell Count: al3GetRDroppedCellCount ................ 88 Returning Rx Underrun Count: al3GetRecvUnderrun................................ 88 Returning Rx Overrun Count: al3GetRecvOverrun.................................... 88 Returning Rx Pointer Reframe Count: al3GetRPtrReframeCount............. 88 Returning Rx Pointer Parity Error Count: al3GetRPtrParErrorCount......... 89 Returning Lost Cell Count: al3GetRLostCellCount .................................... 89 Returning Misinserted Cell Count: al3GetRMisInsertedCellCount ............ 89 Returning Sticky Bits: al3GetStickyBits ...................................................... 90 5.15 UTOPIA Bus Configuration Functions .............................................................. 90 Configuring Utopia Bus: al3UtopiaConfig .................................................. 90 5.16 RAM Interface Configuration Functions............................................................ 91 Configuring RAM Interface: al3RamConfig................................................ 91 5.17 SBI Bus Configuration Functions...................................................................... 92 Configuring SBI Bus: al3SBIConfig............................................................ 92 Configuring SBI Bus Tributarys: al3SBITribConfig..................................... 92 5.18 Direct Line Configuration Functions ................................................................. 93 Configuring Direct Lines: al3DirectConfig .................................................. 93 5.19 Interrupt Service Functions............................................................................... 93 Getting ISR Mask Registers: al3GetMask ................................................. 93 Setting ISR Mask Registers: al3SetMask .................................................. 94 Clearing ISR Mask Registers: al3ClearMask ............................................. 94 Polling ISR Registers: al3Poll .................................................................... 94 ISR Config: al3ISRConfig........................................................................... 95 Reading Interrupt Status Registers: al3ISR ............................................... 95 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 10 AAL1gator-32/-8/-4 Driver User's Manual Device Processing Routine: al3DPR.......................................................... 96 5.20 Counter Functions ............................................................................................ 96 Retrieving Statistical Counts: al3GetCounter ............................................. 96 Retrieving Statistical Counts: al3GetStats .................................................. 97 Clearing Statistical Counts: al3ClearStats .................................................. 97 5.21 Device Diagnostics ........................................................................................... 98 Testing A Single Device Register: al3TestReg ........................................... 98 Testing Device Registers: al3TestRegs...................................................... 98 Testing Data Bus Wiring: al3TestDataBus.................................................. 98 Testing Address Bus Wiring: al3TestAddrBus ............................................ 99 5.22 Callback Functions ........................................................................................... 99 A1SP Callbacks: cbackA1SP................................................................... 100 Utopia Callbacks: cbackUtopia ................................................................ 100 RAM Callbacks: cbackRam...................................................................... 100 SBI Callbacks: cbackSBI.......................................................................... 101 6 Hardware Interface ................................................................................................... 102 6.1 Device I/O ....................................................................................................... 102 Safe Reading from Registers: sysAl3SafeReadReg................................ 102 Reading from Registers: sysAl3ReadReg ............................................... 102 Writing to Registers: sysAl3WriteReg ...................................................... 103 Interrupt Servicing........................................................................................... 103 Installing Handlers: sysAl3ISRHandlerInstall ........................................... 103 Invoking Handlers: sysAl3ISRHandler ..................................................... 103 Removing Handlers: sysAl3ISRHandlerRemove..................................... 104 Invoking DPR Routines: sysAl3DPRTask ................................................ 104 Starting the DPR Tasks: sysAl3DPRTaskStart ......................................... 104 Stopping the DPR Tasks: sysAl3DPRTaskStop ....................................... 104 Starting Statistics Task: sysAl3StatTask ................................................... 105 Starting Statistics Task: sysAl3StatTaskStart............................................ 105 Stopping Statistic Updates: sysAl3StatTaskStop...................................... 106 6.2 7 RTOS Interface......................................................................................................... 107 7.1 Memory Allocation/De-Allocation .................................................................... 107 Allocating Memory: sysAl3MemAlloc ....................................................... 107 Freeing Memory: sysAl3MemFree ........................................................... 107 Buffer Management ........................................................................................ 108 Starting Buffers: sysAl3BufferStart ........................................................... 108 Getting Buffers: sysAl3DPVBufferGet...................................................... 108 Getting Buffers: sysAl3ISVBufferGet ....................................................... 109 Sending Buffers: sysAl3BufferSend ......................................................... 109 Receiving Buffers: sysAl3BufferReceive.................................................. 109 Returning Buffers: sysAl3DPVBufferRtn .................................................. 110 Returning Buffers: sysAl3ISVBufferRtn.................................................... 110 Stopping Buffers: sysAl3BufferStop ......................................................... 110 Timers ..............................................................................................................111 Creating Timer Objects: sysAl3TimerCreate.............................................111 7.2 7.3 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 11 AAL1gator-32/-8/-4 Driver User's Manual Starting Timers: sysAl3TimerStart .............................................................111 Aborting Timers: sysAl3TimerAbort...........................................................111 Deleting Timers: sysAl3TimerDelete .........................................................111 Suspending a Task: sysAl3TimerSleep .................................................... 112 7.4 Semaphores ................................................................................................... 112 Creating Semaphores: sysAl3SemCreate ............................................... 112 Taking Semaphores: sysAl3SemTake...................................................... 113 Giving Semaphores: sysAl3SemGive ...................................................... 113 Deleting Semaphores: sysAl3SemDelete ................................................ 113 Preemption...................................................................................................... 113 Disabling Preemption: sysAl3PreemptDisable......................................... 113 Disabling Preemption: sysAl3PreemptEnable ......................................... 114 7.5 8 Porting Drivers .......................................................................................................... 115 8.1 8.2 Driver Source Files ......................................................................................... 115 Driver Porting Procedures .............................................................................. 115 Procedure 1: Porting Driver RTOS Extensions ........................................ 116 Procedure 2: Porting Drivers to Hardware Platforms............................... 118 Procedure 3: Porting Driver Application-Specific Elements ..................... 119 Procedure 4: Building Drivers .................................................................. 120 Appendix A: Coding Conventions ................................................................................... 121 Macros...................................................................................................... 123 Constants ................................................................................................. 123 Structures ................................................................................................. 123 Functions.................................................................................................. 124 API Functions ........................................................................................... 124 Porting Functions ..................................................................................... 124 Variables................................................................................................... 124 Generic API Files...................................................................................... 126 Device Specific API Files.......................................................................... 126 Hardware Dependent Files ...................................................................... 126 RTOS Dependent Files ............................................................................ 126 Other Driver Files ..................................................................................... 127 Appendix B: Error Codes ................................................................................................ 128 Appendix C: AAL1gator-32 Events ................................................................................. 130 SBI Alarm Events ..................................................................................... 130 SBI Extract Events ................................................................................... 130 SBI Insert Events...................................................................................... 130 UTOPIA Events ........................................................................................ 131 RAM Parity Events ................................................................................... 131 A1SP Events ............................................................................................ 131 Acronyms ........................................................................................................................ 133 List of Terms.................................................................................................................... 135 Index ............................................................................................................................... 137 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 12 AAL1gator-32/-8/-4 Driver User's Manual LIST OF FIGURES Figure 1: Driver Interfaces ................................................................................................ 18 Figure 2: Driver API Components ..................................................................................... 19 Figure 3: Driver Architecture ............................................................................................. 22 Figure 4: State Diagram .................................................................................................... 25 Figure 5: Module Management Flow Diagram.................................................................. 28 Figure 6: Device Management Flow Diagram .................................................................. 29 Figure 7: Interrupt Service Model...................................................................................... 30 Figure 8: Cell Header Interpretation.................................................................................. 34 Figure 9: Driver Source Files .......................................................................................... 115 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 13 AAL1gator-32/-8/-4 Driver User's Manual LIST OF TABLES Table 1: AAL1 Channel Enhanced Parameters Default Values: sAL3_CFG_CHAN_ENH ..................................................................................... 39 Table 2: AAL1 Channel Sequence Number Processing Default Values: sAL3_CFG_CHAN_SNP...................................................................................... 39 Table 3: AAL1 Channel Conditioning Default Values: sAL3_CFG_CHAN_COND ........... 40 Table 4: AAL1 Channel Idle Channel Detection Default Values: sAL3_CFG_CHAN_IDET ..................................................................................... 41 Table 5: Global Clock Default Initialization Profile Values: sAL3_DIV_CLK ..................... 41 Table 6: UTOPIA/Any-PHY Default Initialization Profile Values: sAL3_DIV_UTOPIA ...... 41 Table 7: RAM Default Initialization Profile Values: sAL3_DIV_RAM................................. 43 Table 8: SBI Bus Default Initialization Profile Values: sAL3_DIV_SBI.............................. 43 Table 9: SBI Bus SPE Default Initialization Profile Values: sAL3_DIV_SBI_SPE ............ 44 Table 10: SBI Bus Link Group Default Initialization Profile Values: sAL3_DIV_SBI_LGRP ......................................................................................... 44 Table 11: Direct Line Default Initialization Profile Values: sAL3_DIV_DIRECT ................ 44 Table 12: Module Initialization Vector: sAL3_MIV............................................................. 45 Table 13: Initialization Profile: sAL3_DIV .......................................................................... 45 Table 14: AAL1 Line Configuration: sAL3_DIV_LINE ....................................................... 46 Table 15: Global Clock Configuration: sAL3_DIV_CLK .................................................... 47 Table 16: UTOPIA/Any-PHY Configuration: sAL3_DIV_UTOPIA ..................................... 47 Table 17: RAM Configuration: sAL3_DIV_RAM................................................................ 48 Table 18: SBI Bus Configuration: sAL3_DIV_SBI............................................................. 48 Table 19: SBI Bus SPE Configuration: sAL3_DIV_SPE ................................................... 49 Table 20: SBI Bus Link Group Configuration: sAL3_DIV_LGRP ...................................... 49 Table 21: SBI Bus Tributary Configuration: sAL3_DIV_TRIB ........................................... 49 Table 22: Direct Line Configuration: sAL3_DIV_DIRECT ................................................. 50 Table 23: AAL1 Standard Channel Configuration: sAL3_CFG_CHAN ............................. 50 Table 24: AAL1 Enhanced Channel Configuration: sAL3_CFG_CHAN_ENH.................. 50 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 14 AAL1gator-32/-8/-4 Driver User's Manual Table 25: AAL1 Channel Sequence Number Processing Configuration: sAL3_CFG_CHAN_SNP...................................................................................... 51 Table 26: AAL1 Channel Conditioning Configuration: sAL3_CFG_CHAN_COND........... 51 Table 27: AAL1 Channel Idle Channel Detection Configuration: sAL3_CFG_CHAN_IDET ..................................................................................... 52 Table 28: Counter Specification: sAL3_CNTR_SPEC ...................................................... 52 Table 29: Sticky Bit Error Word: sAL3_STICKY................................................................ 52 Table 30: ISR Mask: sAL3_MASK .................................................................................... 53 Table 31: Module Data Block: sAL3_MDB ........................................................................ 55 Table 32: Device Data Block: sAL3_DDB ......................................................................... 57 Table 33: Module Status Block: sAL3_MSB...................................................................... 58 Table 34: Device Status Block: sAL3_DSB ....................................................................... 58 Table 35: Interrupt Service Vector: sAL3_ISV................................................................... 59 Table 36: Deferred Processing Vector: sAL3_DPV........................................................... 60 Table 37: Variable Type Definitions ................................................................................. 121 Table 38: Naming Conventions ....................................................................................... 122 Table 39: File Naming Conventions ................................................................................ 125 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 15 AAL1gator-32/-8/-4 Driver User's Manual Driver Porting Quick Start 1 DRIVER PORTING QUICK START This section summarizes how to port the AAL1gator-32 device driver to your hardware and Real-time Operating System (RTOS) platform. For more information about porting the AAL1gator-32 driver, see Section 7.5 (page 115). Note: Because each platform and application is unique, this manual can only offer guidelines for porting the AAL1gator-32 driver. AAL1gator-32 driver code is organized into C source files. You may need to modify the code or develop additional code. The code is in the form of constants, macros, and functions. For ease of porting, the code is grouped into source files (src) and include files (inc). The source files contain the functions and the include files contain the constants and macros. To port the AAL1gator-32 driver to your platform: 1. Port the driver's RTOS extensions (page 116): Data types RTOS-specific services Utilities and interrupt services that use RTOS-specific services 2. Port the driver to your hardware platform (page 118): Port the device detection function. Port low-level device read-and-write macros. Define hardware system-configuration constants. 3. Port the driver's application-specific elements (page 119): Define the task-related constants. Code the callback functions. 4. Build the driver (page 120). Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 16 AAL1gator-32/-8/-4 Driver User's Manual Driver Functions and Features 2 DRIVER FUNCTIONS AND FEATURES This section describes the main functions and features supported by the AAL1gator-32 driver. Table 2: Driver Functions and Features Function Description Device Initialization and Reset (page 64) Device Addition and Deletion (page 65) Channel Provisioning (page 70) Statistics Collection and Status Monitoring (page 83) Interrupt Servicing (page 93) Initializes the AAL1gator-32 driver and its associated context structures. This involves reading in an initialization vector that contains various configuration parameters such as interface configuration. The driver validates this vector and the AAL1gator-32 device configures accordingly. The function also resets the AAL1gator-32 and the context information for that device. Allocates and initializes memory to store context information for the device being added. De-allocates device context memory during device shutdown. You must locate the device on the Address Bus before you add the device. Configures the channels of the AAL1gator-32 device by programming channel registers according to application parameters. Polls the various AAL1gator-32 counters so that they do not max out at 16 bits. Monitors device status (via interrupts or polling) and invokes application-defined callback functions when significant alarm/error events occur. Clears the interrupts raised by the AAL1gator-32 and stores the interrupt status for later processing by a deferred processing routine. The deferred processing routine runs in the context of a separate task within the RTOS and takes appropriate actions based on the interrupt status retrieved by the Interrupt Servicing Routine (ISR). This is true for both polled operation or interrupt operation. In polled mode, a separate task polls the interrupt status registers periodically. Once called the flows remain identical to the interrupt mode. Device Diagnostics (page 98) The driver will perform the following optional device diagnostics as part of a power-on self-test: * * Tests register access Tests RAM access Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 17 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture 3 SOFTWARE ARCHITECTURE This section describes the software architecture of the AAL1gator-32 device driver. This includes a discussion of the driver's external interfaces and its main components. 3.1 Driver Interfaces Figure 1 illustrates the external interfaces defined for the AAL1gator-32 device driver. Figure 1: Driver Interfaces Application Indication Callbacks Function Calls Service Callbacks AAL1gator-32 Driver RTOS Service Calls Hardware Interrupts Register Access AAL1gator-32 Device 3.2 Application Programming Interface The driver's API is a collection of high level functions that can be called by application code to configure, control, and monitor the AAL1gator-32 device, such as: * * * * Initializing the device Validating device configuration Retrieving device status and statistics information. Diagnosing the device Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 18 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture The driver API functions use the driver library functions as building blocks to provide this system level functionality (see below). Driver API The Driver Application Programming Interface (API) lists high-level functions that are invoked by application code to configure, control and monitor AAL1gator-32 devices. The API functions perform operations that are more meaningful from a system's perspective. The API includes functions that initialize the devices, perform diagnostic tests, validate configuration information to prevent incorrect configuration of the devices, and retrieve status and statistics information. The Driver API functions use the services of the other driver modules to provide this system-level functionality to the application programmer. In addition, the Driver API consists of callback routines used to notify the application of significant events that take place within the device(s) and module. Figure 2: Driver API Components Alarms and Statistics AAL1 Channel Configuration UTOPIA/AnyPhy Configuration SBI Bus Configuration RAM Configuration Direct Line Configuration Driver API Alarms and Statistics Alarms and Statistics functions are responsible for tracking devices status information and accumulating statistical counts for each device registered with (added to) the driver. This information is stored for later retrieval by the application software, and is also responsible for generating various alarms. AAL1 Channel Configuration AAL1 Channel Configuration functions are responsible for the provisioning and configuration of AAL1 Channels. This includes activating channels for structured and unstructured lines. For structured lines, timeslots are bundled to create AAL1 channels. These lines or bundles of timeslots then map to ATM VCs and in the process have several operating parameters configured. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 19 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture AAL1 Channels are configured by using some or all of the available operating parameters. The "standard" channel configuration functions allow the user to easily configure an AAL1 channel by using defaults for most of the channel configuration parameters. The "enhanced" channel configuration functions open up all the configuration options to the user and are grouped so that a user can selectively configure a group or leave it in the default configuration. The AAL1 channel configuration groups supported are: standard (the minimal parameters); enhanced; sequence number processing; conditioning; and idle detection. The user can configure AAL1 channels in any combination of the above UTOPIA/Any-PHY Configuration The UTOPIA/Any-PHY bus is the interface to the ATM side of the AAL1gator-32 devices. The source (Tx) and sink (Rx) sides of the bus are separately configurable. RAM Configuration The RAM interface is the interface between the AAL1gator-32 devices and their SRAMs, and it is here that configuration and statistics data structures are stored. SBI Bus Configuration The SBI bus is a parallel interface to TDM traffic that is only supported by the AAL1gator-32 (not the AAL1gator-8 and AAL1gator-4). This interface is capable of delivering combinations of T1/E1/DS3 to the AAL1gator-32 device. This section is responsible for configuring the SBI Bus Interface. SBI tributary types and mappings are configurable. The AAL1gator-32 device supports two pages of SBI Tributary mappings, one of which is configured as active by the application (the other is left inactive). This support enables the application to make changes to the inactive page before returning to active mode. Direct Line Configuration The Direct Line interface bypasses the SBI and H/MVIP blocks and brings clock & data signals out of the Device for connection to external framer(s). The Direct Line Interface supports DS3 & E3, E1 & T1 connections. 3.3 Real Time Operating System The RTOS interface module provides functions that enable the driver to use RTOS services. The AAL1gator-32 driver requires memory, interrupt, and preemption services from the RTOS. The RTOS interface functions perform the following tasks for the AAL1gator-32 device and driver: * Allocate and deallocate memory Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 20 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture * * Manage buffers for the DPR and ISR Start and stop task execution The RTOS interface also includes service callbacks. These functions are called by the driver in order to use RTOS service calls, such as install interrupts and start timers. Note: You must modify RTOS interface code to suit your RTOS. 3.4 Driver Hardware Interface The AAL1gator-32 hardware interface provides functions that read from and write to AAL1gator-32 device-registers. The hardware interface also provides a template for an ISR that the driver calls when the device raises a hardware interrupt. You must modify this function based on the interrupt configuration of your system. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 21 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture 3.5 Main Components Figure 3 illustrates the top level architectural components of the ALL1gator-32 device driver. This applies in both polled and interrupt driven operation. In interrupt driven mode, the Hardware interrupt is vectored to an application function that in turn calls the driver's ISR API al3ISR(). The al3ISR reads the device status, clears the cause(s) of the interrupt and creates a message that is sent to the DPR. In polled mode, the application makes a periodic call to al3Poll(),which in turn executes some of the functionality of the ISR (in order to read the Device status), and creates a message that is sent to the DPR. The driver includes four main modules: * * * * Driver library module Device data-block module Interrupt-service routine module Deferred-processing routine module Figure 3: Driver Architecture Application Function Calls Service Callbacks AAL1gator-32 Device Driver Register Access AAL1gator-32 Device RTOS Interface Service Calls RTOS Indication Callbacks Driver API Deferred Processing Routine Device Data Block Driver Library Functions Interrupt Context Interrupt Servicing Routine Hardware Interface Hardware Interrupts Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 22 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Driver Library Module The driver library module is a collection of low-level utility functions that manipulate the device registers and the contents of the driver's Device Data-Block (DDB). The driver library functions serve as building blocks for higher level functions that constitute the driver API module. Application software does not usually call the driver library functions. Device Data-Block Module The Device Data-Block Module (DDB) stores context information about the AAL1gator32 device, such as: * * * * * Device state Control information Initialization vectors Callback function pointers Statistical counts The driver allocates context memory for the DDB when the driver registers a new device. Module Data Block The Module Data Block (MDB) and Module Status Block (MSB) are the top layer data structures. They are created by the AAL1gator-32 device driver to keep track of its initialization and operating parameters, modes and dynamic data. The MDB allocates via an RTOS call at the time the driver first initializes. The module also contains the MSB and all the Device Structures. The Device Data Block (DDB) and Device Status Block (DSB) are contained in the MDB and initialized by the AAL1gator-32 Module for each Device that is registered. This keeps track of the Device's initialization and operating parameters, modes and dynamic data. There is a limit on the number of Device Blocks (Devices) available, and it is important to note that the USER sets that limit when the Module initializes. Interrupt-Service Routine Module The AAL1gator-32 driver provides an ISR called al3ISR that checks if any valid interrupt conditions are present for the device. This function can be used by a systemspecific interrupt-handler function to service interrupts raised by the device. The low-level interrupt-handler function that traps the hardware interrupt and calls al3ISR, is system and RTOS dependent. Therefore, it is outside the scope of the driver. See page 103 for a detailed explanation of the platform specific routines that must be supplied by the user. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 23 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Deferred-Processing Routine Module The Deferred-Processing Routine Module provided by the AAL1gator-32 driver (al3DPR) clears and processes interrupt conditions for the device. Typically a system specific function, which runs as a separate task within the RTOS, executes the DPR. See page 104 for a detailed explanation of the DPR and interrupt-servicing model. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 24 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture 3.6 Software State Description Figure 4 shows the software state diagrams for the AAL1gator-32 module and device(s) as maintained by the driver. Figure 4: State Diagram al3ModuleOpen IDLE al3ModuleClose START al3ModuleStop al3ModuleStart al3ModuleClose READY START MODULE STATES al3Add al3Delete PRESENT al3Reset al3Reset al3Init al3Activate ACTIVE al3DeActivate INACTIVE PER-DEVICE STATES The diagram shows state transitions made on the successful execution of the corresponding transition routines. State information helps maintain the integrity of the MDB and DDB(s) by controlling the set of operations allowed in each state. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 25 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture 3.7 Module States Start The AAL1gator-32 driver Module is not initialized. The only API function accepted in this state is al3ModuleOpen. In this state the driver does not hold any RTOS resources (memory, timers, etc), has no running tasks, and performs no actions. Idle The AAL1gator-32 driver Module initializes successfully via the API function al3ModuleOpen. The Module Initialization Vector (MIV) has been validated, the Module Data Block (MDB) has been allocated and loaded with current data; the perdevice data structures are allocated; and the RTOS has responded favorably to all the requests sent to it by the driver. The only API functions accepted in this state are al3ModuleStart and al3ModuleClose. Ready The normal operating state for the driver Module is "Ready" and can be entered by a call to al3ModuleStart. All RTOS resources allocate and the driver is ready for additional devices. The API functions accepted here for Module control are al3ModuleStop, and al3ModuleClose. The driver Module remains in this state while Devices are in operation. Add devices via al3Add. 3.8 Device States The following is a description of the AAL1gator-32 per-device states. Start The AAL1gator-32 Device is not initialized. The only API function accepted in this state is al3Add. In this state the device is unknown by the driver and performs no actions. Present The AAL1gator-32 Device has been successfully added via the API function al3Add. A Device Data Block (DDB) is associated to the Device and a device handle is provided for the USER. In this state, the device performs no actions. The only API functions accepted in this state are al3Init and al3Delete. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 26 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Active The normal operating state for the Device(s) enters by a call to al3Activate. State changes initiate from the ACTIVE state via al3DeActivate, al3Reset and al3Delete. Inactive Enter "Inactive" via the al3Init or al3DeActivate function calls. In this state the Device remains configured but all data functions de-activate. This includes interrupts and Alarms, Status and Statistics functions. al3Activate will return the device to the ACTIVE state, while al3Reset or al3Delete will de-configure the Device. Queues are torn down. 3.9 Processing Flows This section describes the main processing flows of the AAL1gator-32 driver modules. The flow diagrams presented here illustrate the sequence of operations that take place for different driver functions. The diagrams also serve as a guide to the application programmer by illustrating the sequence in which the application must invoke the driver API. Module Management The following diagram illustrates the typical function call sequences that occur when initializing or shutting down the AAL1gator-32 driver module. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 27 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Figure 5: Module Management Flow Diagram START al3ModuleOpen Performs module level initialization of the AAL1gator-32 driver. Validates the Module Initialization Vector (MIV). Allocates memory for the MDB and all its components (i.e. all the memory needed by the driver) and then initializes the contents of the MDB with the validated MIV. Performs module level startup of the driver. This involves allocating RTOS resources such as semaphores and timers. al3ModuleStart al3AddInitProfile Register an initialization profile. This allows the user to store pre-defined parameter vectors that are validated ahead of time. When the deviceinitialization function is invoked only a profile number need to be passed. This method simplifies and expedites the above operations. Performs all device level functions here (add, init, activate, de-activate, reset, delete) al3DeleteInitProfile De-registers an initialization profile previously registered with the driver. al3ModuleStop Performs Module level shutdown of the driver. This involves deleting all devices currently installed and de-allocating all RTOS resources. al3ModuleClose Performs module level shutdown of the driver. Deletes all devices currently registered with the driver and de-allocates all the driver's memory. END Device Management The following figure shows the functions and process that the driver uses to add, initialize, re-initialize, and delete the AAL1gator-32 device. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 28 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Figure 6: Device Management Flow Diagram START Detects the device being added in the hardware (using sysA13GetDevAddr), performs a register readback test (using a13RegisterTest), allocates memory for storing device context information, and applies a software reset to the device (using a13Reset). Initializes the device based on an initialization vector provided by the application. The initialization vector is validated by the application and stored by the driver as part of device context information. The device registers are then configured accordingly. Prepares the device for normal operation by enabling interrupts and other global enables. Installs an ISR function using sysA13IntInstallHandler. The device is now operational and all other APIs can be invoked. Re-initializes the device, resets the device using a13Reset, and goes through the initialization sequence again. al3Add al3Init al3Activate al3Reset al3Deactivate De-activates the device and removes it from normal operation. This involves disabling the device interrupts and other global enables, such as links. Removes the ISR routine for this device using sysA13IntRemoveHandler. Applies a software reset to the device to put it in its default startup state. al3Reset al3Delete Removes the device from the list of devices being controlled by the AAL1gator-32 driver. This function de-allocates the device context information for the device being deleted. END 3.10 Interrupt Servicing The AAL1gator-32 driver services device interrupts using an interrupt service routine (ISR) that traps interrupts. It also uses a deferred interrupt-processing routine (DPR) that actually processes the interrupt conditions and clears them. This action lets the ISR execute quickly and exit. Most of the time-consuming processing of the interrupt conditions defers to the DPR by queuing the necessary interrupt-context information to the DPR task. The DPR function runs in the context of a separate task within the RTOS. Note: Since the DPR task processes potentially serious interrupt conditions, you should set the DPR task's priority higher than the application task interacting with the AAL1gator-32 driver. The driver provides system-independent functions, al3ISR and al3DPR. You must fill in the corresponding system-specific functions, sysAl3ISR and sysAl3DPR. The system-specific functions isolate the system-specific communication mechanism (between the ISR and DPR) from the system-independent functions, al3ISR and al3DPR. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 29 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Figure 7 illustrates the interrupt service model used in the AAL1gator-32 driver design. Figure 7: Interrupt Service Model sysA13IntHandler a13ISR Interrupt Status sysA13DPRTask a13DPR Indication Callbacks Application Note: Instead of using an interrupt service model, you can use a polling service model in the AAL1gator-32 driver to process the device's event-indication registers (see page 31). Calling al3ISR An interrupt handler function, which is system dependent, calls al3ISR. Before this, however, the low-level interrupt-handler function traps the device interrupts. You must implement this function for your system. For your reference, an example implementation of the interrupt handler (sysAl3IntHandler) appears on page 103 .You can customize this example implementation to suit your needs. The implemented interrupt handler (sysAl3IntHandler) installs in the interrupt vector table of the system processor. It calls when one or more AAL1gator-32 devices interrupt the processor. The interrupt handler subsequently calls al3ISR for each device in the active state. The al3ISR function reads from the master interrupt-status register and the miscellaneous interrupt-status register of the AAL1gator-32. If a valid status bit is set, al3ISR then returns with the status information. Thereafter, sysAl3IntHandler function sends a message to the DPR task. The DPR task consists of the device handles of all the AAL1gator-32 devices that have had valid interrupt conditions. Note: Normally you should store status information for deferred interrupt processing by implementing a message queue. The interrupt handler sends the status information to the queue by the sysAl3IntHandler. Calling al3DPR The sysAl3DPRTask function is a system specific function that runs as a separate task within the RTOS. You should set the DPR task's priority higher than the application task(s) interacting with the AAL1gator-32 driver. In the message-queue implementation model, this task has an associated message queue. The task waits for messages from the ISR on this message queue. When a message arrives, sysAl3DPRTask calls the DPR (al3DPR). The al3DPR then processes the status information and takes appropriate action based on the specific interrupt condition detected. The nature of this processing can differ from system to system. As a result, al3DPR calls different indication callbacks for different interrupt conditions. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 30 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Typically, you should implement these callback functions as simple message posting functions that post messages to an application task. However, you can implement the indication callback to perform processing within the DPR task context and return without sending any messages. In this case, ensure that the indication function does not call any API functions that change the driver's state, such as al3Delete. In addition, ensure that the indication function is non-blocking, as the DPR task executes while AAL1gator-32 interrupts are disabled. These callbacks can be customized to suit your system. See page 99 for example implementations of the callback functions. Note: Since the al3ISR and al3DPR routines do not specify a communication mechanism, you have full flexibility in choosing a communication mechanism between the two. A convenient way to implement this communication mechanism is to use a message queue, which is a service that most RTOS' provide. You must implement the two system specific functions, sysAl3IntHandler and sysAl3DPRTask. When the driver calls sysAl3IntInstallHandler for the first time, the driver installs sysAl3IntHandler in the interrupt vector table of the processor. The sysAl3DPRTask function is also spawned as a task during the first time invocation of sysAl3IntInstallHandler. The sysAl3IntInstallHandler function also creates the communication channel between sysAl3IntHandler and sysAl3DPRTask. This communication channel is most commonly a message queue associated with the sysAl3DPRTask. Similarly, during removal of interrupts, the driver removes sysAl3IntHandler from the microprocessor's interrupt vector table and deletes the task associated with sysAl3DPRTask. As a reference, this manual provides example implementations of the interrupt installation and removal functions on page 103. You can customize these prototypes to suit your specific needs. 3.11 Polling Instead of using an interrupt service model, you can use a polling model in the AAL1gator-32 driver to process the device's event-indication registers. The following figure illustrates the polling model used in the AAL1gator-32 driver design. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 31 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture Figure 9: Polling Model sysA13DPRTask a13DPR Indication Callbacks Application Task Delay The polling code includes some system specific code (prefixed by "sysAl3"), which typically you must implement for your application. The polling code also includes some system independent code (prefixed by "al3") provided by the driver that does not change from system to system. In polling mode, sysAl3IntHandler and al3ISR are not used. Instead, the application spawns a sysAl3DPRTask function as a task processor when the driver calls sysAl3IntInstallHandler for the first time. In sysAl3DPRTask, the driver-supplied DPR (al3DPR) periodically calls active devices. The al3DPR reads from the master interrupt-status and miscellaneous interrupt-status registers of the AAL1gator-32. If some valid status bits are set, it processes the status information and takes appropriate action based on the specific interrupt condition detected. The nature of this processing differs from system to system. Consequently, the DPR calls different indication callbacks for different interrupt conditions. You can customize these callbacks to fit your application's specific requirements. See page 99 for a description of these callback functions. Similarly, during the removal of polling the driver removes the task associated with sysAl3DPRTask if the AAL1gator-32 devices do not activate. 3.12 Device Configuration This section describes the various configuration operations performed by the driver. AAL1 Channel Configuration AAL1 channel configuration handles the provisioning and configuring of AAL1 channels inside the AAL1gator -32/-8/-4. The API for this section of the driver consists of several functions in five groups. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 32 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture The first is the channel provisioning group which consists of five functions. The first function, al3ActivateChannelUnstr, activates an AAL1 channel using a T1, E1, DS3, or E3 in unstructured mode. This AAL1 channel occupies that entire line. The next function, al3ActivateChannelStr, activates an AAL1 channel using one or more timeslots of a T1 or E1 line. Both al3ActivateChannelStr and al3ActivateChannelUnstr have enhanced versions. The enhanced versions offer extra configuration parameters such as max buffer size, cdvt, AAL0 mode, etc. The enhanced versions also allow the user to configure sequence number processing, conditioning and idle channel detection. If a NULL pointer passes for any of the channel configuration data structures, the al3EnhancedActivateChannelStr and al3EnhancedActivateChannelUnstr functions will use the default values for those data structures. These are the same defaults used when the non-enhanced Activate functions are invoked. The last function in this group, al3DeActivateChannel, deactivates an already provisioned AAL1 channel. The second API group can add or remove timeslots of a T1 or E1 to or from an AAL1 channel. The function al3AssociateChannel adds timeslots to an AAL1 channel and the function al3DisAssociateChannel removes timeslots from an AAL1 channel. The third API group is the SRTS (Synchronous Residual Time Stamp) group, which consists of two functions. The first function, al3SRTSEnable, enables SRTS and the second function, al3SRTSDisable, disables it. Note: The AAL1gator-32/-8/-4 line level, not at the AAL1 channel level, controls the SRTS. The fourth API group is the Conditioning group, and consists of four functions. The first function, al3EnableTxCond, enables conditioning in the Tx direction. The second, al3DisableTxCond, disables conditioning in the Tx direction. The third, al3EnableRxCond, enables conditioning in the Rx direction and the fourth, al3DisableRxCond, disables conditioning in the Rx direction. The final API group is the Loopback group, which consists of two functions. The first function, al3LpbkEnable, puts an AAL1 channel in loopback mode and the second, al3LpbkDisable, takes the AAL1 channel out of loopback mode. Finally, there is one function to configure clock generation for the lines on the AAL1gator-32/-8/-4device. The function, al3GlobalClkConfig, configures the adaptive filter size for the adaptive clock source method and the NCLK frequency for SRTS clock method. Table 5 on page 41 shows the default values for global clock configuration UTOPIA/Any-PHY Bus Configuration UTOPIA/Any-PHY Bus configuration sets up the UTOPIA or Any-PHY bus on the AAL1gator-32. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 33 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture The AAL1gator-32's UTOPIA/Any-PHY bus interface is capable of supporting an 8-bit or 16-bit wide bus, Level 1 or Level 2; as well as act as a Level 1 Bus Slave or Bus Master. On a Level 2 bus it can only act as a Bus Slave. Odd or Even Parity check can also be selected. The UTOPIA/Any-PHY interface can be placed in remote loopback, so that all cells received by the AAL1gator-32/-8/-4 are looped back out the UTOPIA interface. Loopbacks are also possible on a per-VC basis towards the line. The UTOPIA/Any-PHY interface has to identify which AAL1 Channel a particular VC is associated with. A mapping VPI:VCI to AAL1 Channel Queue method (Cell Header Interpretation) does this. The AAL1gator-32/-8/-4 devices support 3 methods for doing this. Figure 8 illustrates the three methods. Figure 8: Cell Header Interpretation Method 1 11 10 9 8 7 6 5 Ignored 15 14 13 Ignored 12 11 10 A1SP 9 8 Data 7 6 Line 5 4 3 2 1 0 4 3 2 1 0 Queue MOD 32 Method 2 11 10 9 8 7 6 5 Ignored 4 3 2 1 0 15 Ignored 14 13 A1SP 12 Data 11 10 Line 9 8 7 6 5 4 3 Ignored 2 1 0 Queue MOD 32 Method 3 for UDF only 15 14 13 12 11 10 9 8 Ignored 7 6 5 4 A1SP 3 2 1 Line 0 11 10 Ignored 9 8 7 6 Ignored 5 4 3 2 Ignored 1 0 For Method 3, VCI is ignored, Queue Number 0 is assumed. There is only one UTOPIA/Any-PHY related function in the API, al3UtopiaConfig configures the UTOPIA/Any-PHY interface according to the parameters passed to this function. There is a default initialization profile defined with the driver. The Initialization Profiles on page 41 include the UTOPIA/Any-PHY configuration. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 34 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture RAM Interface Configuration The AAL1gator-32/-8/-4 RAM interface supports one of either Synchronous SRAMs or ZBT RAMs. These RAMs store some AAL1gator-32/-8/-4 data structures. The AAL1gator-32/-8/-4 can also check Even or Odd parity on the RAMs' data buses and generate parity error interrupts to the microprocessor. There are 2 RAM interfaces supported by the AAL1gator-32, and 1 RAM interface supported by both AAL1gator-8 and AAL1gator-4. The API for this section of the AAL1gator-32 consists of only one function, al3RAMConfig, which passes the RAM configuration parameters and performs the necessary actions to configure the RAM interface according to the parameters. RAM Initialization Profiles are included in Table 7, page 43 SBI Bus Configuration The SBI (Scaleable Bandwidth Interconnect) Bus is a parallel bus used for transmitting TDM data between physical and data link layer devices. This interface is one of the 4 possible TDM side interfaces that the AAL1gator-32 supports. The other 3 are the Direct Line Low Speed, the H-MVIP bus and the Direct High Speed interface. The latter 2 require no software configuration. The AAL1gator-32's SBI interface allows a lot of flexibility in mapping SBI bus tributaries to AAL1gator-32 links. The SBI bus tributaries can be T1, E1, or DS3 payloads. The AAL1gator-32's SBI bus interface supports handling all these tributary types, there are however some limitations. All tributaries in an SPE (Synchronous Payload Envelope) must be of the same type and all AAL1gator-32 links in a link group must also be of the same type. There are 3 SPEs supported by the SBI bus, and there are 2 16-link link groups inside the AAL1gator-32. Other than these limitations, you are free to map the tributaries inside the SPEs on the SBI bus to any of the AAL1gator-32's thirty-two links. The API for this section of the AAL1gator-32 consists of two functions, al3SBIConfig and al3SBITribConfig. The first configures the 3 SPEs and 2 Link Groups according to the parameters passed to it. The second configures the individual tributaries and maps them to one of the 32 AAL1gator-32 links. SBI Bus configuration profiles are included in Table 8, page 43. Note: The SBI bus is not supported by the AAL1gator-8 and AAL1gator-4 devices. Direct Line Interface Configuration The Direct Line Low Speed interface is a direct clock and data interface to a T1/E1 framer. This interface is one of the 4 possible TDM side interfaces that the AAL1gator-32 supports. The other 3 are the SBI bus, the H-MVIP bus and the Direct High Speed interface. The AAL1gator-8 and AAL1gator-4 do not support the SBI bus. The AAL1gator-32 can support up to 16 direct low speed interfaces. The AAL1gator-8 can support up to 8 and the AAL1gator-4 can support up to 4. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 35 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture The API for this section of the AAL1gator-32 consists of one function, al3DirectConfig, which configures the AAL1gator-32/-8/-4's low speed direct line interface based on the parameters passed to it. Direct Line Interface configuration profiles are included in Table 11, page 44. Alarms and Statistics Most of the statistics for the AAL1gator-32 relate to the AAL1 channels provisioned through it. There are some statistics related to OAM cells that are per AAL1 SAR Processor (A1SP), although the Statistic Retrieval Functions for OAM statistics are per device. There are 4 A1SPs in the AAL1gator-32, and 1 A1SP in both the AAL1gator-8 and AAL1gator-4. Software extends statistics to 32-bits from 16 bits. A periodic task achieves this as part of the Statistics Section. This task periodically polls all the hardware counters and updates their software counterparts respectively. The user adjusts the period of this task's execution. The task calls sysAl3UpdateStats. Alarms and Statistics functions also generate alarms. SBI bus tributary alarms are enabled and disabled using al3EnableSBIAlarm and al3DisableSBIAlarm. Note: These functions are only valid for the AAL1gator-32 device. This section also allows you to force a high-speed line configured for DS3 to generate cells with the AIS pattern using al3EnableDS3AISCells and al3DisableDS3AISCells. 3.13 Constants The driver code uses the following Constants: * * API functions and used in the global error number field of the MDB and DDB. AL3_MAX_DEVICES: defines the maximum number of devices supported by this driver. This constant must not be changed without a thorough analysis of the consequences to the driver code. AL3_MAX_LINES: defines the maximum number of lines per device. This constant * must not be changed without a thorough analysis of the consequences to the driver code. (Limit should be 32 for AAL1gator-32, 8 for AAL1gator-8 and 4 for AAL1gator-4) * per device. This constant must not be changed without a thorough analysis of the consequences to the driver code. (Limit should be 16 for AAL1gator-32, 8 for AAL1gator-8 and 4 for AAL1gator-4) AL3_MAX_DIRECT: defines the maximum number of direct low speed line interfaces Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 36 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture * AL3_MAX_SPES: defines the maximum number of synchronous payload envelopes (SPEs) on the SBI bus for each device. This constant must not be changed without a thorough analysis of the consequences to the driver code. (Limit should be 3). * AL3_MAX_TRIBS: defines the maximum number of tributaries inside each SPE on the SBI bus for each device. This constant must not be changed without a thorough analysis of the consequences to the driver code. (The maximum allowed tribs within an SPE is 28 for T1, 21 for E1, and 1 for DS3). AL3_MAX_LGRPS: defines the maximum number of link groups (line groups) per * device. This constant must not be changed without a thorough analysis of the consequences to the driver code. (Limit should be 2). AL3_MAX_QUEUES: defines the maximum number of AAL1 channel queues per device. This constant must not be changed without a thorough analysis of the consequences to the driver code. (Limit should be 1024 for AAL1gator-32, 256 for ALL1gator-8, and 128 for ALL1gator-4). AL3_MDB_USER_SIZE: defines the size in UINT4s of the User Defined field in the * * * MDB. DDB. AL3_DDB_USER_SIZE: defines the size in UINT4s of the User Defined field in the 3.14 Variables Although variables within the driver are not meant to be used by the application code, there are several that can used by the application code. They are to be considered readonly by the application. * * al3MDB: a global pointer to the Module Data Block (MDB). The MDB is only valid if the `valid' flag is set. errModule: this MDB structure element is used to store an error code that specifies the reason for an API function's failure. The field is only valid when the function in question returns an AL3_FAIL value. * * * * modState: this MDB structure element stores the Module state. modValid: this MDB structure element indicates that the MDB contains valid data. al3DDB[ ]: An array of pointers to the individual Device Data Blocks. The DDB is only valid if the `valid' flag is set and that the array of DDBs is in no particular order. errDevice: this MDB structure element stores an error code that specifies the reason for an API function's failure. The field is only valid when the function in question returns an AL3_FAIL value. The various Read/Write API functions store error codes here, as well as the Device Diagnostic functions. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 37 AAL1gator-32/-8/-4 Driver User's Manual Software Architecture * * devState: this structure element stores the Device state. devValid: this structure element indicates that the DDB contains valid data. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 38 AAL1gator-32/-8/-4 Driver User's Manual Data Structures 4 4.1 DATA STRUCTURES Data Structures The following are the main data structures employed by the AAL1gator-32 driver. AAL1 Channel Configuration Tables The following tables detail the provisioning and configuring of AAL1 channels inside the AAL1gator-32. Table 1: AAL1 Channel Enhanced Parameters Default Values: sAL3_CFG_CHAN_ENH Field Name partialFill rxMaxBuf rxCDVT txSuppress Default Value Field Type Field Description 0x00 UINT1 Partial Cell Fill Char Maximum Buffer Size Cell Delay Variation Tolerance Suppress TX (0-Disable, 1Enable) Maintain Bit Integrity through Underrun (0-Disable, 1-Enable) Add Queue Scheduling Offset AAL0 Mode (0-AAL1, 1-AAL0) GFC for TX VC PTI for TX VC CLP for TX VC HEC for TX VC Calculated Max UINT2 Buffer Size 0x10 Disabled UINT2 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 maintnBitInteg Disable addQueOffset aal0Mode txGfc txPti txClp txHec 0x00 AAL1 0x00 0x00 0x00 Calculated HEC Table 2: AAL1 Channel Sequence Number Processing Default Values: sAL3_CFG_CHAN_SNP Field Name snpAlgorithm Default Value Fast Field Type Field Description RX SN Processing (0-Fast, 1Robust, 2-Disabled) UINT1 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 39 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name insertDataMode Default Value Insert AIS Field Type Field Description Format of Data Inserted for Lost Cells (0-Insert AIS, 1Insert Conditioned Data, 2Insert Old Data, 3-Insert Conditioned Data with MSB randomized) Value of conditioned data inserted Maximum number of cells inserted [1-7 cells] Don't Drop First Cell (0Disabled, 1-Enabled) UINT1 insertCondCellData maxInsert noStartDrop 0xFF 6 Disabled UINT1 UINT1 UINT1 Table 3: AAL1 Channel Conditioning Default Values: sAL3_CFG_CHAN_COND Field Name txCondMode txCondSig txCondData rxCondSig rxCondData rxCondMode Default Value Both 0x0 0xFF 0x0 0xFF Conditioned Data Field Type Field Description Conditioning Mode (0-Both, 1Only Signaling, 2-Only Data) TX Side Conditioned Signaling Nibble TX Side Conditioned Data Byte RX Side Conditioned Signaling Nibble RX Side Conditioned Data Byte RX Underrun Data (0Conditioned Data, 1Conditioned Data with MSB randomized, 2-Old Data) RX Underrun Signaling (0Freeze Signaling, 1Conditioned Signaling) UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 rxSigMode Freeze Signaling UINT1 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 40 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Table 4: AAL1 Channel Idle Channel Detection Default Values: sAL3_CFG_CHAN_IDET Field Name idleDetEnable Default Value Disable Field Type Field Description Enable Idle Channel Detection (0-Disable, 1-Enable [DBCES], 2-Enable [Non-DBCES]) RX CAS Idle Pattern (CAS Matching) TX CAS Idle Pattern (CAS Matching) RX Mask (CAS or Processor Matching) TX Mask (CAS or Processor Matching) Idle Pattern (Pattern Matching) Pattern Mask (Pattern Matching) UINT2 rxCASPattern txCASPattern rxMask txMask idlePattern patternMask 0x00 0x00 0x00 0x00 0x00 0x00 UINT2 UINT2 UINT2 UINT2 UINT2 UINT2 . Table 5: Global Clock Default Initialization Profile Values: sAL3_DIV_CLK Field Name adapFiltSize nClkDivEnable nClkDivFactor Default Value 0 Disabled 0 Field Type Field Description Adaptive Clock Filter Size (0>16) NCLK Division Enable (0Disabled, 1-Enabled) NCLK Division Factor [nClkDivFactor+2] (0->7) UINT1 UINT1 UINT1 UTOPIA/Any-PHY Bus Configuration Table The following tables detail setting up the UTOPIA or Any-PHY bus on the AAL1gator 32/-8/-4. Table 6: UTOPIA/Any-PHY Default Initialization Profile Values: sAL3_DIV_UTOPIA Field Name enable Default Value Enabled Field Type Field Description UTOPIA/Any-PHY bus enable (0-Disabled, 1-Enabled) UINT1 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 41 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name vpiVciMapping Default Value Method 1 Field Type Field Description VCI range used for mapping to AAL1 Channel Queue numbers (0-Method 1, 1-Method 2, 2Method 3) UTOPIA/Any-PHY loopback (0-None, 1-Remote, 2-VCI Remote) UTOPIA/Any-PHY loopback 16bit VCI Source Any-PHY Mode (0UTOPIA, 1-Any-PHY) Source UTOPIA/Any-PHY bus width (0-8bit, 1-16bit) Source UTOPIA bus mode (0ATM, 1-PHY) Source UTOPIA/Any-PHY 16bit slave address Source UTOPIA/Any-PHY parity (0-Odd, 1-Even) Source Any-PHY Chip Select Mode (0-Disabled, 1-Enabled) Sink Any-PHY Mode (0UTOPIA, 1-Any-PHY) Sink UTOPIA/Any-PHY bus width (0-8bit, 1-16bit) Sink UTOPIA bus mode (0ATM, 1-PHY) Sink UTOPIA/Any-PHY 16-bit slave address Sink UTOPIA/Any-PHY parity (0-Odd, 1-Even) Sink Any-PHY Chip Select Mode (0-Disabled, 1-Enabled) UINT1 loopbk None UINT1 lpbkVci srcAnyPhyMode srcBusWidth srcUtopMode srcSlaveAddr srcParity srcCSMode snkAnyPhyMode snkBusWidth snkUtopMode snkSlaveAddr snkParity snkCSMode 0x1111 UTOPIA 16bit PHY 0x0000 Odd Disabled UTOPIA 16bit PHY 0x0000 Odd Disabled UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 RAM Interface Configuration Table The following table depicts the default RAM configuration stored in the default initialization profile. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 42 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Table 7: RAM Default Initialization Profile Values: sAL3_DIV_RAM Field Name protocol parity Default Value SSRAM Odd Field Type Field Description SRAM protocol (0-SSRAM, 1ZBT) SRAM parity type (0-Odd, 1Even) UINT1 UINT1 SBI Bus Configuration Tables The following tables depict the default SBI SPE and Link Group configuration stored in the default initialization profile. Table 8: SBI Bus Default Initialization Profile Values: sAL3_DIV_SBI Field Name mapEnable Default Value Mapping Enabled Field Type Field Description Tributary mapping (0-Forced, 1-Forced on Extract Only, 2Forced on Insert Only, 3Mapping Enabled) Force Clock Mastering (0-Use Trib Cfg setting, 1-Force) Bus Master (0-Disabled, 1Enabled) Separate C1FP for Insert and Extract bus (0-Disabled, 1Enabled) Insert Bus parity (0-Even, 1Odd) Extract Bus parity (0-Even, 1Odd) Active Configuration Page (0Page 1, 1-Page 2) SPE (Synchronous Payload Envelope) configuration AAL1gator-32 Link Group configuration UINT1 clkMaster busMaster twoC1FPEnable Use Trib Cfg Setting Disabled Disabled UINT1 UINT1 UINT1 insBusParity extBusParity page speCfg [AL3_MAX_SPES] linkGrpCfg [AL3_MAX_LGRPS] Odd Odd 1 See below See below UINT1 UINT1 UINT1 sAL3_DIV_SB I_SPE sAL3_DIV_SB I_LGRP Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 43 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Table 9: SBI Bus SPE Default Initialization Profile Values: sAL3_DIV_SBI_SPE Field Name speType speEnable speSync Default Value DS1 Enable Asynchronous Field Type Field Description SPE type (0-DS1, 1-E1, 2-DS3) SPE enable (0-Disable, 1Enable) SPE sync (0-Asynchronous, 1Synchronous) UINT1 UINT1 UINT1 Table 10: SBI Bus Link Group Default Initialization Profile Values: sAL3_DIV_SBI_LGRP Field Name lgrpType clkKill Default Value DS1 Disable Field Type Field Description Link Group type (0-DS1, 1E1, 2-DS3) Clock Kill (0-Disable, 1Enable) UINT1 UINT1 Direct Line Interface Configuration Table The following table depicts the default Direct Low Speed configuration stored in the default initialization profile. Table 11: Direct Line Default Initialization Profile Values: sAL3_DIV_DIRECT Field Name syncMode Default Value Frame Disable Field Type Field Description Direct Line Sync Mode (0Frame, 1-MultiFrame) MVIP Mode (0-Disable, 1Enable) UINT1 UINT1 mvipMode 4.2 Structures Passed by the Application The application defines these structures and passes them by reference to functions within the driver. Module Initialization Vector Passed via the al3ModuleOpen call, this structure contains all the information needed by the driver to initialize and connect to the RTOS. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 44 AAL1gator-32/-8/-4 Driver User's Manual Data Structures * maxDevs informs the Driver how many Devices will be operating concurrently during this session. The number calculates the amount of memory allocated to the driver. Memory is allocated in the al3ModuleOpen call. The maximum value passed is AL3_MAX_DEVS. * autoStart tells the Driver to automatically start connecting to the RTOS. If the flag is ZERO, the Module will be initialized only, and the application will have to call al3ModuleStart at a later time. initializes. If the flag is ZERO, the Module will be initialized only, and the application will have to call the diagnostic routines directly. diagOnInit is a flag that tells the Driver to run diagnostic routines when the device * Table 12: Module Initialization Vector: sAL3_MIV Field Name pMDB maxDevs maxInitProfs autoStart diagOnInit Field Type INT4 * UINT2 UINT2 BOOLEAN BOOLEAN Field Description Pointer to MDB Maximum number of devices supported during this session Maximum number of initialization profiles If non-zero, al3ModuleStart is called internally If non-zero, diagnostic routines will be executed when every device is initialized. Initialization Profile Initialization Profile Top-Level Structure Passed via the al3SetInitProfile and or al3Init call, this structure contains all the information needed by the driver to initialize and activate an AAL1gator-32 device. * autoActivate tells the Driver to activate the Device being initialized. If the flag is ZERO, the Device will be initialized but left inactive, and the application will have to call al3Activate at a later time. Table 13: Initialization Profile: sAL3_DIV Field Name modeHS autoActivate Field Type BOOLEAN BOOLEAN Field Description High-Speed Mode Indicates that the device should be initialized directly to the ACTIVE state by calling al3Activate internally Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 45 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name cfgLINE[AL3_MAX_A1SPS ][AL3_LINES_PER_A1SP] cfgCLK[AL3_MAX_A1SPS] cfgUtopia cfgRam cfgSbi cfgTRIB[AL3_SIZE_SPE] [AL3_SIZE_TRIB] cfgDirect[AL3_SIZE_DI RECT] modeISR cbackA1SP cbackUtopia cbackRAM cbackSBI Field Type sAL3_DIV_LINE sAL3_DIV_CLK sAL3_DIV_UTOPIA sAL3_DIV_RAM sAL3_DIV_SBI sAL3_DIV_TRIB sAL3_DIV_DIRECT AL3_ISR_MODE sAL3_CBACK sAL3_CBACK sAL3_CBACK sAL3_CBACK Field Description AAL1gator-32 Line configuration block AAL1gator-32 Global Clock configuration block UTOPIA configuration block RAM configuration block SBI Bus configuration block SBI Bus Tributary configuration block Direct Line configuration block Indicates the type of ISR/polling to do Address for the callback function for A1SP Events Address for the callback function for UTOPIA bus Events Address for the callback function for RAM Events Address for the callback function for SBI bus Events Initialization Profile Sub-Structures Initialization Profile Sub-Structures appear in the initialization profile tables below. Table 14: AAL1 Line Configuration: sAL3_DIV_LINE Field Name lowCDV refValEnable t1Mode sigType hiResClkSynth mfAlign Field Type UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description Low CDV (0-Disable [frame based scheduling], 1Enable [byte based scheduling]) Enable Reference Value generation (0-OFF, 1-ON) Mode (0-E1, 1-T1) Signaling (0-E1 with E1 signaling, 1-E1 with T1 signaling) [For E1 Line type only] Hi Resolution Clock Synthesis (0-Disable, 1-Enable) Multiframe Align Enable (0-Disable, 1-Enable) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 46 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name genSync txClkSrc Field Type UINT1 UINT1 Field Description Generate TL_SYNC (0-Receive, 1-Generate) Tx Clock Source (0-External, 1-Looped, 2-Nominal, 3-SRTS, 4-Adaptive, 5-Externally Controlled, 6Common, 7-Common w/TL_SIG) Rx Clock Source (0-External, 1-Common) Frame Type (0-Unused, 1-SDF_FR, 2-UDF, 3-SDFMF) Enable SRTS (0-OFF, 1-ON) SRTS CDVT (if enabled) CAS nibble shifting (0-coincident with the second nibble of data, 1-coincident with the first nibble of data) Idle Channel Detection Configuration: 0 - Disabled, 1 - Processor, 2 - CAS Matching, 3 - Pattern Matching Interval Length rxClkSrc frameType srtsEnable srtsCDVT shiftCAS UINT1 UINT1 UINT1 UINT1 UINT1 iDetCfg UINT1 iDetIntvlLen UINT1 Table 15: Global Clock Configuration: sAL3_DIV_CLK Field Name adapFiltSize nClkDivEnable nClkDivFactor Field Type UINT1 UINT1 UINT1 Field Description Adaptive Clock Filter Size (0->16) NCLK Division Enable (0-Disabled, 1-Enabled) NCLK Division Factor [nClkDivFactor+2] (0->7) Table 16: UTOPIA/Any-PHY Configuration: sAL3_DIV_UTOPIA Field Name enable vpiVciMapping Field Type UINT1 UINT1 Field Description UTOPIA/Any-PHY bus enable (0-Disabled, 1Enabled) VPI:VCI mapping to AAL1 Channel Queue numbers method (0-Method 1, 1-Method 2, 2Method 3 [for all UDF only]) [Please see Theory of Operations for Mapping method explanations] UTOPIA/Any-PHY loopback (0-None, 1-Remote, 2-VCI Remote) UTOPIA/Any-PHY loopback 16bit VCI Source Any-PHY Mode (0-UTOPIA, 1-Any-PHY) Source UTOPIA/Any-PHY bus width (0-8bit, 116bit) loopbk lpbkVci srcAnyPhyMode srcBusWidth UINT1 UINT1 UINT1 UINT1 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 47 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name srcUtopMode Field Type UINT1 Field Description Source UTOPIA bus mode (0-L1 Master, 1-L1 Slave, 2-L2 Single Address Slave, 3-L2 Multiple Address Slave) Source UTOPIA/Any-PHY 16-bit slave address Source UTOPIA/Any-PHY parity (0-Odd, 1-Even) Source Any-PHY Chip Select Mode (0-Disabled, 1Enabled) Sink Any-PHY Mode (0-UTOPIA, 1-Any-PHY) Sink UTOPIA/Any-PHY bus width (0-8bit, 1-16bit) Sink UTOPIA bus mode (0-L1 Master, 1-L1 Slave, 2-L2 Single Address Slave, 3-L2 Multiple Address Slave) Sink UTOPIA/Any-PHY 16-bit slave address Sink UTOPIA/Any-PHY parity (0-Odd, 1-Even) Sink Any-PHY Chip Select Mode (0-Disabled, 1Enabled) srcSlaveAddr srcParity srcCSMode snkAnyPhyMode snkBusWidth snkUtopMode UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 snkSlaveAddr snkParity snkCSMode UINT1 UINT1 UINT1 Table 17: RAM Configuration: sAL3_DIV_RAM Field Name protocol parity Field Type UINT1 UINT1 Field Description SRAM protocol (0-SSRAM, 1-ZBT) SRAM parity type (0-Odd, 1-Even) Table 18: SBI Bus Configuration: sAL3_DIV_SBI Field Name mapEnable clkMaster busMaster twoC1FPEnable insBusParity extBusParity page Field Type UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description Tributary mapping (0-Forced, 1Mapping Enabled) Force Clock Mastering (0-Use Trib Cfg setting, 1-Force) Bus Master (0-Disabled, 1-Enabled) Separate C1FP for Insert and Extract bus (0-Disabled, 1-Enabled) Insert Bus parity (0-Even, 1-Odd) Extract Bus parity (0-Even, 1-Odd) Active Configuration Page (0-Page 1, 1-Page 2) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 48 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name speCfg [AL3_MAX_SPES] linkGrpCfg [AL3_MAX_LGRPS] Field Type sAL3_CFG_SPE sAL3_CFG_LGRP Field Description SPE (Synchronous Payload Envelope) configuration AAL1gator-32 Link Group configuration Table 19: SBI Bus SPE Configuration: sAL3_DIV_SPE Field Name speType speEnable speSync Field Type UINT1 UINT1 UINT1 Field Description SPE type (0-DS1, 1-E1, 2-DS3) SPE enable (0-Disable, 1-Enable) SPE sync (0-Asynchronous, 1-Synchronous) Table 20: SBI Bus Link Group Configuration: sAL3_DIV_LGRP Field Name lgrpType clkKill Field Type UINT1 UINT1 Field Description Link Group type (0-DS1, 1-E1, 2-DS3) Clock Kill (0-Disable, 1-Enable) Table 21: SBI Bus Tributary Configuration: sAL3_DIV_TRIB Field Name link enable type insClkMaster extClkMaster extClkMode insSynchMode Field Type UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description Link (line number) associated with this trib Tributary Enable (0-Disabled, 1-Enabled, 2-Only Insert Enabled, 3-Only Extract Enabled) Tributary type (0-Structured w/CAS, 1-Structured w/o CAS, 2-Unstructured) Tributary Clock Master on Insert Bus (0-Clock slave, 1-Clock master) Tributary Clock Master on Extract Bus (0-Clock slave, 1-Clock master) Tributary Clock Mode for Extract Bus (0EXT_CKCTL, 1-ClkRate, 2-Phase) Tributary Synch for Insert Bus (0-Float, 1-Locked) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 49 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Table 22: Direct Line Configuration: sAL3_DIV_DIRECT Field Name syncMode mvipMode Field Type UINT1 UINT1 Field Description Direct Line Sync Mode (0-Frame, 1-MultiFrame) MVIP Mode (0-Disable, 1-Enable) AAL1 Channel Configration Parameters Table 23: AAL1 Standard Channel Configuration: sAL3_CFG_CHAN Field Name txVpi txVci rxVpi rxVci rxCheckParity suppressSignaling Field Type UINT2 UINT2 UINT2 UINT2 UINT1 UINT1 Field Description VPI for TX VC VCI for TX VC VPI for RX VC VCI for RX VC Parity Check (0-Off, 1-On) Suppress Signaling (0-Off, 1-On) [for SDF-MF only] Table 24: AAL1 Enhanced Channel Configuration: sAL3_CFG_CHAN_ENH Field Name partialFill rxMaxBuf rxCDVT txSuppress maintnBitInteg addQueOffset aal0Mode txGfc txPti txClp Field Type UINT1 UINT2 UINT2 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description Partial Cell Fill Char Maximum Buffer Size Cell Delay Variation Tolerance Suppress TX (0-Disable, 1-Enable) Maintain Bit Integrity through Underrun condition (0-Disable, 1-Enable) Add Queue Scheduling Offset AAL0 Mode (0-AAL1, 1-AAL0) GFC for TX VC PTI for TX VC CLP for TX VC Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 50 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name txHec Field Type UINT1 Field Description HEC for TX VC Table 25: AAL1 Channel Sequence Number Processing Configuration: sAL3_CFG_CHAN_SNP Field Name snpAlgorithm insertDataMode Field Type UINT1 UINT1 Field Description RX SN Processing (0-Fast, 1-Robust, 2-Disabled) Format of Data Inserted for Lost Cells (0-Insert AIS, 1-Insert Conditioned Data, 2-Insert Old Data, 3-Insert Conditioned Data with MSB randomized) Value of conditioned data inserted Maximum number of cells inserted [1-7 cells] Don't Drop First Cell (0-Disabled, 1-Enabled) insertCondCellData maxInsert noStartDrop UINT1 UINT1 UINT1 Table 26: AAL1 Channel Conditioning Configuration: sAL3_CFG_CHAN_COND Field Name txCondMode txCondSig txCondData rxCondSig rxCondData rxCondMode rxSigMode Field Type UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description Conditioning Mode (0-Both, 1-Only Signaling, 2-Only Data) TX Side Conditioned Signaling Nibble TX Side Conditioned Data Byte RX Side Conditioned Signaling Nibble RX Side Conditioned Data Byte RX Underrun Data (0- Conditioned Data, 1-Conditioned Data with MSB randomized, 2-Old Data) RX Underrun Signaling (0-Freeze Signaling, 1Conditioned Signaling) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 51 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Table 27: AAL1 Channel Idle Channel Detection Configuration: sAL3_CFG_CHAN_IDET Field Name idleDetEnable rxCASPattern txCASPattern rxMask txMask idlePattern patternMask Field Type UINT2 UINT2 UINT2 UINT2 UINT2 UINT2 UINT2 Field Description Enable Idle Channel Detection (0-Disable, 1-Enable [DBCES], 2-Enable [Non-DBCES]) RX CAS Idle Pattern (CAS Matching) TX CAS Idle Pattern (CAS Matching) RX Mask (CAS or Processor Matching) TX Mask (CAS or Processor Matching) Idle Pattern (Pattern Matching) Pattern Mask (Pattern Matching) Counter Specification Table 28: Counter Specification: sAL3_CNTR_SPEC Field Name rdata wdata aspNum lineNum queNum queId type Field Type UINT4 UINT4 UINT2 UINT2 UINT2 sAL3_QID AL3_CNTR_T YPE Field Description Read Data Write Data A1SP Number (Not required if queId is specified) Line Number (Not required if queId is specified) Queue Number (Not required if queId is specified) Queue Id Counter Type To Return Sticky Bit Error Word Table 29: Sticky Bit Error Word: sAL3_STICKY Field Name transfer cellRcvd dbcesBitMaskErr Field Type BOOLEAN BOOLEAN BOOLEAN Field Description Transferring data to the sticky bits A Cell was received There was a parity error in the DBCES Bit Mask Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 52 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name transfer ptrRuleErr allocTblBlank ptrSearch forcedUndr snCellDrop ptrRcvd ptrParErr srtsResume srtsUndrn resume ptrMismatch overrun underrun Field Type BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN Field Description Transferring data to the sticky bits There was a violation of a pointer generation rule A cell was dropped because of a blank allocation table A cell was dropped because a valid pointer has not yet been found A cell was dropped because a forced underrun condition exists A cell was dropped in accordance with the "SN Algorithm" A pointer was received A cell was received with a pointer parity error An SRTS resume has occurred A cell was received while the SRTS queue was in underrun A resume has occurred; a valid cell was received and stored into the buffer A cell was dropped because of a pointer mismatch A cell was dropped due to overrun A cell was received while this queue was in underrun ISR Enable/Disable Mask Passed via the al3MaskSet, al3MaskGet and al3MaskClear calls, ISR Enable/Disable Mask contains all the information needed by the driver to enable and disable any of the interrupts in the AAL1gator-32. Note: For all interrupts in the ISR mask, there are masks that allow you to mask out a whole group of interrupts. If you specify "Enable Some" for these you can mask the interrupts individually. Table 30: ISR Mask: sAL3_MASK Field Name ram ram1 ram2 Field Type UINT1 UINT1 Field Description RAM 1 parity RAM 2 parity Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 53 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name alarmSBI exSBI sync fifoOvr fifoUdr parity inSBI sync fifoOvr fifoUdr a1sp [AL3_MAX_A1SPS] master oam talpFifoFull frmAdvFifoFull rxStatFifoFull rxStatFifoNotEmpty txIdleFifoFull txIdleFifoNotEmpty sticky cellRx dbces ptrRule allocTbl ptrSrch fRedUndr snCellDrop ptrRx ptrParity srtsRes Field Type UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description SBI Alarm Extract bus DC, SBIIP or C1FP Error Extract FIFO Overrun Extract FIFO Underrun Extract Bus Parity Error Insert bus DC, SBIIP or C1FP Error Insert FIFO Overrun Insert FIFO Underrun A1SP in MASTER register A1SP OAM A1SP TALP FIFO Full A1SP Frame Advance FIFO Full A1SP RX Status FIFO Full A1SP RX Status FIFO Not Empty A1SP TX Idle State FIFO Full A1SP TX Idle State FIFO Not Empty Cell Received Sticky Bit DBCES Bit Mask Error Sticky Bit Pointer Rule Error Sticky Bit Allocation Table Blank Sticky Bit Pointer Search Sticky Bit Forced Underrun Sticky Bit SN Cell Drop Sticky Bit Pointer Received Sticky Bit Pointer Parity Error Sticky Bit SRTS Resume Sticky Bit Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 54 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name srtsUndr res ptrMis ovr undr rxStatResync txStatResync rxStatBitmask rxStatUdrExit rxStatUdrEnter rxStatQueError utopia parity runtCell transErr fifo lpbkFifo Field Type UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 UINT1 Field Description SRTS Underrun Sticky Bit Resume Sticky Bit Pointer Mismatch Sticky Bit Overrun Sticky Bit Underrun Sticky Bit Rx Line entered a resync state Tx Line entered a resync state DBCES exited Underrun QUEUE exited Underrun QUEUE entered Underrun QUEUE Error (Sticky Bits) UTOPIA Parity UTOPIA Runt cell UTOPIA Cell Transfer Error UTOPIA FIFO Full UTOPIA Loopback FIFO Full 4.3 Structures in the Driver's Allocated Memory Structures located in the Driver's Allocated Memory are used by the driver, and are part of the context memory allocated when the driver is opened. Module Data Block The MDB is the top-level structure for the Module, containing configuration data about the Module level code, and pointers to configuration data about Device level codes. Table 31: Module Data Block: sAL3_MDB Field Name errModule Field Type INT4 Field Description Module based error code Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 55 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name maxDevs maxDIVs autoStart diagOnInit modState modValid numDevs numDIVs timerModule semModule bufOK isrOK appMDB updActive vpiModeOK [AL3_MAX_DEVICES] user [AL3_MDB_USER_SIZE] modMSB divAddr pDIV [AL3_MAX_DIVS] ddbAddr pDDB [AL3_MAX_DEVICES] Field Type UINT2 UINT2 BOOLEAN BOOLEAN UINT2 UINT2 UINT2 UINT2 void * void * BOOLEAN BOOLEAN BOOLEAN BOOLEAN BOOLEAN UINT4 sAL3_MSB sAL3_DIV * sAL3_DIV * sAL3_DDB * sAL3_DDB * Field Description Maximum number of devices that can be added Maximum number of DIVs (profiles) Automatic start on Open Run diagnostics during the al3Init() Current module state This structure is valid Current number of added devices Current number of Added Profiles (DIVs) (pointer to) Timer ID variable (pointer to) Semaphore ID variable sysAl3BufferStart succeeded sysAl3ISRHandlerInstall succeeded MDB memory was passed by the application Statistics are being gathered. Accumulation of LINE modes Extra space for use by the Application Module status block Address of the DIVs in the MDB DIV pointer array Address of the DDBs in the MDB DDB pointer array Device Data Block The DDB is the top-level structure for each Device, containing configuration data about the Device level code, and pointers to configuration data about Device level sub-blocks. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 56 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Table 32: Device Data Block: sAL3_DDB Field Name errDevice baseAddr usrCtxt autoInit divNum modeISR cbackRAM cbackSBI cbackA1SP cbackUtopia numQUE numA1SP numLINE numDIRECT ramEndAddr devState devValid devNum revision lineMode hwFail activePageEXSBI activePageINSBI sbiLinkMap [AL3_MAX_L INES] speNum tribNum insPage extPage statUpdateTime statUpdatePeriod txOAMCount [AL3_MAX_A1SPS] Field Type INT4 UINT2* void * BOOLEAN UINT2 AL3_ISR_MODE sAL3_CBACK sAL3_CBACK sAL3_CBACK sAL3_CBACK UINT2 UINT2 UINT2 UINT2 UINT4 UINT2 UINT2 UINT2 UINT2 UINT2 BOOLEAN UINT2 UINT2 UINT1 UINT1 UINT1 UINT1 UINT4 UINT4 UINT2 Field Description Global return code for Device functions Base address of the Device Application-specific use Copy of flag from profile Profile Number to be used for Initialization Indicates the current type of ISR/Polling RAM Events SBI Bus Events A1SP Events UTOPIA Bus Events Maximum Number of Queues for the Device Maximum Number of A1SPs for the Device Maximum Number of Lines for the Device Maximum Number of Low Speed Lines for the Device SRAM ending address for the device Current state of the Device Structure is Valid Index into al3DDB[] Device Revision Data Current Line Mode HW Failure Flag Current `in-use' page for EXSBI Block Current `in-use' page for INSBI Block SPE number Tributary number INSBI page EXSBI page Tracks STATS updates Tracks STATS updates per A1SP TX OAM Cell Counter Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 57 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name user [AL3_DDB_USER_SIZE] a1sp [AL3_MAX_A1SP] mask devDSB, devCntr Field Type UINT4 sAL3_ADB sAL3_MASK sAL3_DSB Field Description USER data area A1SP Structures (above) ISR Mask Current Device Status Block (counters) Module Status Block The Module Status Block holds Alarm, Status and Statistics information for the Module, as well as dynamic configuration information that can be modified by the USER. Table 33: Module Status Block: sAL3_MSB Field Name valid moduleOK Field Type UINT2 UINT2 Field Description Indicates that this structure is valid General health of the Module Device Status Block The Device Status Block holds Alarm, Status and Statistics information for the Device, as well as dynamic configuration information that can be modified by the USER. Table 34: Device Status Block: sAL3_DSB Field Name counter a1sp [AL3_MAX _A1SP] rxOAMCellCnt rxDroppedOAMCellCnt txOAMCellCnt line[[AL3_ LINES_PER_ A1SP] rxQue[AL3_ QUEUES_PER LINE] seqErrCnt Field Type UINT4 UINT4 UINT4 UINT4 UINT4 Field Description Counter Return Value RX OAM cell count RX dropped OAM cell count TX OAM cell count RX sequence error count Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 58 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Field Name A1SP] _LINE] badSNPCnt cellCnt stickyBits Field Type UINT4 UINT4 UINT4 Field Description RX bad SNP count RX cell count RX sticky bits RX dropped cell count RX underrun count RX lost cell count RX Overrun count RX pointer reframe count RX pointer parity error count RX misinserted cell count TX conditioned cell count TX suppressed cell count TX cell count droppedCellCnt UINT4 underrunCnt lostCellCnt overrunCnt ptrReFrameCnt ptrPerrCnt UINT4 UINT4 UINT4 UINT4 UINT4 misInsertedCel UINT4 lCnt rxQue[AL3_ QUEUES_PER _LINE] condCellCnt supCellCnt cellCnt UINT4 UINT4 UINT4 4.4 Structures Passed Through RTOS Buffers Interrupt Service Vector The Interrupt Service Vector is used in two ways. First, it determines the size of buffer required by the RTOS for use in the driver. Second, it is the template for data captured during ISR processing and thereafter sending it to the Deferred Processing Routine (DPR). Table 35: Interrupt Service Vector: sAL3_ISV Field Name devId master Field Type sDEV_HNDL UINT2 Field Description Device Handle Master Interrupt Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 59 AAL1gator-32/-8/-4 Driver User's Manual Data Structures Deferred Processing Vector The Deferred Processing Vector is used in two ways. First, it determines the size of buffer required by the RTOS for use in the driver. Second, it also acts as a template for data assembled by the DPR and sent to the application code. Note: the application code is responsible for returning this buffer to the RTOS buffer pool. Table 36: Deferred Processing Vector: sAL3_DPV Field Name data index Field Type UINT2 UINT2 Field Description Additional information describing the event Additional information describing the event - only used for A1SP event. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 60 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5 APPLICATION PROGRAMMING INTERFACE This section provides a detailed description of each function that is a member of the AAL1gator-32 driver Application Programming Interface (API). 5.1 Module Initialization Opening Modules: al3ModuleOpen This function performs module level initialization of the device driver. This involves allocating all of the memory needed by the driver and initializing the Module Data Block (MDB) with the passed Module Initialization Vector (MIV). Prototype Inputs Outputs Returns INT4 al3ModuleOpen(sAL3_MIV *pMIV) pMIV: (pointer to) Module Initialization Vector pointer to MDB passed through the MIV Success = AL3_OK Failure = Valid States Side Effects MOD_START Changes the STATE of the MODULE to MOD_IDLE Closing Modules: al3ModuleClose This function performs module level shutdowns of the driver. This involves deleting all devices controlled by the driver (by calling al3Delete for each device) and deallocating the MDB. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3ModuleClose(void) None None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 61 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.2 Module Activation Starting Modules: al3ModuleStart This function performs module level startup of the driver. This involves allocating RTOS resources such as buffers, semaphores and timers AND installing the ISR handler and DPR task. Prototype Inputs Outputs Returns INT4 al3ModuleStart(void) None None Success = AL3_OK Failure = Valid States Side Effects MOD_IDLE Changes MODULE state to MOD_READY Stopping Modules: al3ModuleStop This function performs module level shutdown of the driver. This involves deleting all devices controlled by the driver and de-allocating all RTOS resources. Prototype Inputs Outputs Returns INT4 al3ModuleStop(void) None None Success = AL3_OK Failure = Valid States Side Effects READY and ALL DEVICE STATES Changes MODULE state to MOD_IDLE Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 62 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.3 Profile Management Creating Initialization Profiles: al3AddInitProfile This function creates an initialization profile stored by the driver. Passing the initialization profile number can initialize devices simply. Prototype Inputs INT4 al3AddInitProfile(sAL3_DIV *pDIV, UINT2 *pDIVNum) pDIV : pDIVNum: pointer to initialization profile to be added (pointer to) a variable that holds the profile number Outputs Returns the resulting profile number Success = AL3_OK Failure = Valid States Side Effects ALL MODULE STATES except MOD_START None Getting Initialization Profiles: al3GetInitProfile This function Gets the contents of an initialization profile given its profile number. Prototype Inputs Outputs Returns INT4 al3GetInitProfile(UINT2 profNum, sAL3_DIV *pDIV) profNum: pDIV: profile number pointer to profile the resulting profile data Success = AL3_OK Failure = Valid States Side Effects ALL MODULE STATES except MOD_START None Deleting Initialization Profiles: al3DeleteInitProfile This function deletes an initialization profile given its profile number. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 63 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Prototype Inputs Outputs Returns INT4 al3DeleteInitProfile(UINT2 profNum) profNum: initialization profile number None Success = AL3_OK Failure = Valid States Side Effects ALL MODULE STATES except MOD_START None 5.4 Device Initialization Initializing Devices: al3Init This function initializes the Device Data Block (DDB) associated to that device during al3Add, applies a reset to the device itself, and configures it according to the profile number passed by the Application. This function also calls the al3Activate function directly when the autoActivate flag is set in the profile. This function can also automatically run some diagnostics on the device before configuring it. This occurs if the diagOnInit flag was set in the MIV used in the al3ModuleOpen function call. Prototype Inputs INT4 al3Init(sDEV_HNDL devId, sAL3_DIV *pDIV, UINT2 profileNum) devId: pDIV: device Handle (from al3Add) (pointer to) the profile for this Device - OR - profileNum: profile number Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Resetting Devices: al3Reset This function applies a software reset to the AAL1gator-32 device. The function also resets all the DDB contents (except for the user context). This function is typically called before re-initializing the device. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 64 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3Reset(sDEV_HNDL devId) devId: device Handle (from al3Add) None Success = AL3_OK Failure = 5.5 Device Addition and Deletion Adding Devices: al3Add This function verifies the presence of a new device in the hardware; configures a Device Data block (DDB); stores the contents of the passed Device Initialization Vector (DIV), and passes a pointer to the DDB. Prototype Inputs sDEV_HNDL al3Add(void *usrCtxt, UINT2 *baseAddr, INT4 **pperrDevice) usrCtxt: baseAddr: pointer to user context pointer to base address pperrDevice: pointer to the location for the pointer of the device error to be stored Outputs Returns Valid States Side Effects Places a pointer to the DDB into the DIV passed by the Application. Success = Device handle Failure = NULL (MOD_READY) START Changes the DEVICE state to PRESENT Deleting Devices: al3Delete This function removes the specified device from the list of devices controlled by the AAL1gator-32 driver. Deleting a device involves clearing the DDB for that device and releasing its associated device handle. Prototype Inputs INT4 al3Delete(sDEV_HNDL devId) devId: device Handle (from al3Add) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 65 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = 5.6 Device Activation and De-Activation Activating Devices: al3Activate This function restores the state of a device after a de-activate. Interrupts may be reenabled; queues are not restored. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3Activate(sDEV_HNDL devId) devId: device Handle (from al3Add) None Success = AL3_OK Failure = Deactivating Devices: al3DeActivate This function de-activates the device from operation. Interrupts are masked and the device is put into the soft reset state. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3DeActivate(sDEV_HNDL devId) devId: device Handle (from al3Add) None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 66 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.7 Device Reading and Writing Reading from Devices: al3Read This function reads a register of a specific AAL1gator-32 device by providing the register number. This function derives the actual address location based on the device handle and register number inputs. It then reads the contents of this address location using the system specific macro, sysAl3ReadReg. Note: A failure to read returns a zero and any error indication writes to the DDB. Prototype Inputs Outputs Returns Valid States Side Effects UINT2 al3Read(sDEV_HNDL devId, UINT4 regNum) devId regNum : device Handle (from al3Add) : register number ERROR code written to the DDB Success = the register value Failure = 0x00 (MOD READY) PRESENT, ACTIVE, INACTIVE May affect registers that change after a read operation Writing to Devices: al3Write This function writes to a register of a specific AAL1gator-32 device by providing the register number. This function derives the actual address location based on the device handle and register number inputs. It then writes the contents of this address location using the system specific macro, sysAl3WriteReg. Note: A failure to write returns a zero and any error indication writes to the DDB Prototype Inputs UINT2 al3Write(sDEV_HNDL devId, UINT4 regNum, UINT2 wdata) devId regNum wdata : device Handle (from al3Add) : register number value: value to be written : data to write Outputs Returns Valid States Side Effects ERROR code written to the DDB Success = pre-READ register value Failure = 0x00 (MOD_READY) PRESENT, ACTIVE, INACTIVE May change the configuration of the Device; some registers require unused bits to be '0' Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 67 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Reading from Register Blocks: al3ReadBlock This function reads from a block of Device Registers. It can be used to read a contiguous register block of a specified Aal1gator 32/8/4 device by providing the starting register number, and the number of registers to read. This function derives the actual start address location based on the device handle and starting register number inputs. It then reads the contents of the associated register data block using multiple calls to the system specific macro, sysAl3ReadReg. Note: A failure to read returns a zero and any error indication writes to the associated DDB. Prototype Inputs UINT2 al3ReadBlock(sDEV_HNDL devId, UINT4 regNum, UINT4 length, UINT2 *pBlock) devId: regNum: length: pBlock: device Handle (from al3Add) register number number of registers to read (pointer to) block read area Outputs Returns Valid States Side Effects ERROR code written to the DDB pBlock is filled with the register data Success = last value read Failure = 0x00 (MOD READY) PRESENT, ACTIVE, INACTIVE May affect registers that change after a read operation Writing to Register Blocks: al3WriteBlock This function writes to a block of Device Registers. It can be used to write a contiguous register block of a specified Aal1gator 32/8/4 device by providing the starting register number, and the number of registers to write. This function derives the actual start address location based on the device handle and starting register number inputs. It then writes the contents of the associated register data block using multiple calls to the system specific macro, sysAl3WriteReg. Note: A failure to write returns a zero and any error indication writes to the associated DDB. Prototype Inputs UINT2 al3WriteBlock(sDEV_HNDL devId, UINT4 regNum, UINT4 length, UINT2 *pBlock) devId: regNum: length: pBlock: device Handle (from al3Add) start of block register number of registers in the block (pointer to) block of write data Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 68 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Outputs Returns Valid States Side Effects ERROR code written to the DDB Success = last previous value found Failure = 0x00 (MOD READY) PRESENT, ACTIVE, INACTIVE May change the configuration of the device Reading from Indirect Registers: al3ReadInd This function reads an Indirect Device register. It can be used to Write an Indirect control or mapping register of the SBI block of a specified Aal1gator 32/8/4 device by providing the Page, SPE & Tributary numbers to read. This function derives the actual start address location based on the device handle and input parameters. It then reads the contents of the associated register data block using the system specific macro, sysAl3ReadReg Note: A failure to read returns a zero and any error indication writes to the associated DDB. Prototype Inputs UINT2 al3ReadInd(sDEV_HNDL devId, AL3_SECTION section, BOOLEAN map, UINT2 pageNum, UINT2 speNum, UINT2 tribNum) devId: section: map: pageNum: speNum: tribNum: device Handle (from al3Add) INSBI or EXSBI read from control registers or map registers SBI memory page SBI SPE SBI tributary Outputs Returns Valid States Side Effects ERROR code written to the DDB Success = last value read Failure = 0x00 (MOD READY) PRESENT, ACTIVE, INACTIVE May affect registers that change after a read operation Writing to Indirect Registers: al3WriteInd This function writes to an Indirect Device register. It can be used to Write an Indirect control or mapping register of the SBI block of a specified Aal1gator 32/8/4 device by providing the Page, SPE & Tributary numbers to read. This function derives the actual start address location based on the device handle and input parameters. It then reads the contents of the associated register data block using the system specific macro, sysAl3WriteReg. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 69 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Note: A failure to write returns a zero and any error indication writes to the associated DDB. Prototype UINT2 al3WriteInd(sDEV_HNDL devId, AL3_SECTION section, BOOLEAN map, UINT2 pageNum, UINT2 speNum, UINT2 tribNum, UINT2 wdata) devId: section: map: pageNum: speNum: tribNum: wdata: Inputs device Handle (from al3Add) INSBI or EXSBI read from control registers or map registers SBI memory page SBI SPE SBI tributary write data Outputs Returns Valid States Side Effects ERROR code written to the DDB Success = last previous value found Failure = 0x00 (MOD READY) PRESENT, ACTIVE, INACTIVE May change the configuration of the device 5.8 AAL1 Channel Provisioning Setting Line Modes: al3SetLineMode This function sets the line mode for one of the AAL1gator-32 lines. Prototype Inputs INT4 al3SetLineMode(sDEV_HNDL devId, UINT2 linkNum, sAL3_DIV_LINE *pParms) devId: linkNum: pParms: device Handle (from al3Add) A1SP, Line number points to LINE parameters structure Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 70 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Configuring Underrun Data: al3SetUnderrun This function configures Underrun Data and Signaling on a timeslot basis. Only use this function, if you want to specify separate underrun parameters for each timeslot in a given queue. Prototype Inputs INT4 al3SetUnderrun(sDEV_HNDL devId, UINT2 linkNum, UINT2 timeSlot, UINT2 rxData, UINT2 rxSig) devId: linkNum: timeSlot: rxData: rxSig: device Handle (from al3Add) specifies the line number to configure specifies the timeslot to configure new default Rx Conditioned Data new default Rx Conditioned Signaling Data Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Setting Global Clock Configuration: al3GlobalClkConfig This function sets the Global clock configuration for the AAL1gator-32 device. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3GlobalClkConfig(sDEV_HNDL devId, sAL3_DIV_CLK *pParms) devId: pParms: device Handle (from al3Add) points to Config params None Success = AL3_OK Failure = Activating Channels: al3ActivateChannel This function maps the channels of a T1 or an E1 line in Structured Data Format (SDF) or the entire line in Unstructured Data Format (UDF) to a VP/VC. al3ActivateChannel returns a queue handle for future mapping operations. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 71 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Prototype Inputs INT4 al3ActivateChannel(sDEV_HNDL devId, sAL3_QID *queId, UINT2 txLink, UINT4 channels, sAL3_CFG_CHAN *pParms) devId: queId: txLink: channels: pParms: device Handle (from al3Add) pointer to queue handle A1SP, Line & Queue Number bitmap of channels to activate (pointer to) configuration structure Outputs Returns Valid States Side Effects Queue Id via the parameter '*queId' Success = AL3_OK Failure = Deactivating Channels: al3DeActivateChannel This function deactivates the line that is in use, and frees the queue handle. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3DeActivateChannel (sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) specifies the queue handle for the line None Success = AL3_OK Failure = Activating Channels with Enhanced Parameters: al3EnhancedActivateChannel This function maps the channels of a T1 or an E1 line in Structured Data Format (SDF) or the entire line in Unstructured Data Format (UDF) to a VP/VC. It also returns a queue handle used for future operations on the mapping. In addition to the abilities of the aal1ActivateChannel function, this function also enables the extend parameters used in configuring the mapping, as well as parameters for configuring Sequence Number Processing, Conditioning, and Idle Channel Detection. Passing a NULL Pointer in place of a pointer to any of the configuration parameter data structures results in the function using the default parameters for that data structure. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 72 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Note: Passing a NULL Pointer in place of a pointer to any of the configuration parameter data structures results in the function using the default parameters for that data structure. Prototype INT4 al3EnhancedActivateChannel(sDEV_HNDL devId, sAL3_QID *queId, UINT2 txLink, UINT4 channels, sAL3_CFG_CHAN *pParms, sAL3_CFG_CHAN_ENH *pEnhParms, sAL3_CFG_CHAN_SNP *pSNPParms, sAL3_CFG_CHAN_COND *pCondParms, sAL3_CFG_CHAN_IDET *pIDetParms) Inputs devId: queId: device Handle (from al3Add) pointer to queue handle txLink: A1SP, Line & Queue Number channels: bitmap of channels to activate pParms: (pointer to) configuration structure pEnhParms: (pointer to) Enhanced parameters pSNPParms: (pointer to) Sequence Number Processing parameters pCondParms: (pointer to) Conditioning parameters pIDetParms: (pointer to) Idle Detection parameters Outputs Returns Valid States Side Effects Queue Id via the parameter '*queId' Success = AL3_OK Failure = Activating Unstructured Channels: al3ActivateChannelUnstr This function activates a line of the device in Unstructured Data Format (UDF) mode. Returns a queue handle for future operations on the queue. Prototype Inputs INT4 al3ActivateChannelUnstr(sDEV_HNDL devId, sAL3_QID *queId, UINT2 txLink, sAL3_CFG_CHAN *pParms) devId: queId: txLink: pParms: device Handle (from al3Add) pointer to queue handle A1SP, Line & Queue Number (pointer to) configuration structure Outputs Returns Valid States Side Effects Queue Id via the parameter '*queId' Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 73 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Activating Unstructured Channels with Enhanced Parameters: al3EnhancedActivateChannelUnstr This function activates a line of the device in Unstructured Data Format (UDF) mode. al3EnhancedActivateChannelUnstr returns a queue handle enabling future operations on the line. In addition to the abilities of the aal1ActivateLine function, this function also provides the user the ability to provide extended parameters used in configuring the line, as well as parameters for configuring Sequence Number Processing, Conditioning, and Idle Channel Detection. Passing a NULL Pointer in place of a pointer to any of the configuration parameter data structures results in the function using the default parameters for that data structure. Note: Passing a NULL Pointer in place of a pointer to any of the configuration parameter data structures results in the function using the default parameters for that data structure. Prototype INT4 al3EnhancedActivateChannelUnstr(sDEV_HNDL devId, sAL3_QID *queId, UINT2 txLink, sAL3_CFG_CHAN *pParms, sAL3_CFG_CHAN_ENH *pEnhParms, sAL3_CFG_CHAN_SNP pSNPParms, sAL3_CFG_CHAN_COND *pCondParms, sAL3_CFG_CHAN_IDET *pIDetParms) Inputs device Handle (from al3Add) pointer to queue handle A1SP, Line & Queue Number (pointer to) configuration structure (pointer to) Enhanced parameters (pointer to) Sequence Number Processing parameters pCondParms: (pointer to) Conditioning parameters pIDetParms: (pointer to) Idle Detection parameters devId: queId: txLink : pParms : pEnhParms : pSNPParms : Outputs Returns Valid States Side Effects Queue Id via the parameter '*queId' Success = AL3_OK Failure = Deactivating Unstructured Channels: al3DeActivateChannelUnstr This function deactivates the line that is in use, and frees the queue handle. Prototype Inputs Outputs INT4 al3DeActivateChannelUnstr(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) specifies the queue handle for the line None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 74 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Returns Valid States Side Effects Success = AL3_OK Failure = Activating Structured Channels : al3ActivateChannelStr This function maps the channels of a T1 or an E1 line in Structured Data Format (SDF) to a VP/VC. Returns a queue handle that will be used for future operations on the mapping. Prototype INT4 al3ActivateChannelStr(sDEV_HNDL devId, sAL3_QID *queId, UINT2 txLink, UINT4 channels, sAL3_CFG_CHAN *pParms) devId: queId: txLink: channels: pParms: Inputs device Handle (from al3Add) pointer to queue handle A1SP, Line & Queue Number bitmap of channels to activate (pointer to) configuration structure Outputs Returns Valid States Side Effects Queue Id via the parameter '*queId' Success = AL3_OK Failure = Activating Structured Channels With Enhanced Parameters: al3EnhancedActivateChannelStr This function maps the channels of a T1 or an E1 line in Structured Data Format (SDF) to a VP/VC. Returns a queue handle used for future operations on the mapping. In addition to the abilities of the aal1ActivateChannel function, this function provides the user the ability to provide extended parameters used in configuring the mapping, as well as parameters for configuring Sequence Number Processing, Conditioning, and Idle Channel Detection. Passing a NULL Pointer in place of a pointer to any of the configuration parameter data structures results in the function using the default parameters for that data structure. Note: Passing a NULL Pointer in place of a pointer to any of the configuration parameter data structures results in the function using the default parameters for that data structure. Prototype INT4 al3EnhancedActivateChannelStr( sDEV_HNDL devId, sAL3_QID *queId, UINT2 txLink, UINT4 channels, sAL3_CFG_CHAN *pParms, sAL3_CFG_CHAN_ENH *pEnhParms, sAL3_CFG_CHAN_SNP Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 75 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface *pSNPParms, sAL3_CFG_CHAN_COND *pCondParms, sAL3_CFG_CHAN_IDET *pIDetParms) Inputs devId: queId: txLink: channels: pParms: pEnhParms: pSNPParms: device Handle (from al3Add) pointer to queue handle A1SP, Line & Queue Number bitmap of channels to activate (pointer to) configuration structure (pointer to) Enhanced parameters (pointer to) Sequence Number Processing parameters pCondParms: (pointer to) Conditioning parameters pIDetParms: (pointer to) Idle Detection parameters Outputs Returns Valid States Side Effects Queue Id via the parameter '*queId' Success = AL3_OK Failure = Deactivating Structured Channels: al3DeActivateChannelStr This function deactivates the channels on a line that is (are) in use, and frees the queue handle. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3DeActivateChannelStr(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) specifies the queue handle for the channels None Success = AL3_OK Failure = Associating Channels With An Existing Mapping: al3AssociateChannel This function associates more T1/E1 timeslots to an existing mapping. After configuring the mapping, it enables it. Prototype INT4 al3AssociateChannel(sDEV_HNDL devId, sAL3 QID queId UINT4 chanMap) 76 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface sAL3_QID queId, UINT4 chanMap) Inputs devId: queId : chanMap: device Handle (from al3Add) specifies the queue handle for the channels bitmap of the channels to add Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Disassociating Channels With An Existing Mapping: al3DisAssociateChannel This function disassociates already mapped T1/E1 timeslots from an existing mapping. After reconfiguring the mapping, the function enables it. Prototype Inputs INT4 al3DisAssociateChannel (sDEV_HNDL devId, sAL3_QID queId, UINT4 chanMap) devId: queId : chanMap: device Handle (from al3Add) specifies the queue handle for the channels bitmap of the channels to remove Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = 5.9 Channel Conditioning Enabling Transmit Conditioning: al3EnableTxCond This function enables transmit conditioning for an existing channel(s) to VP/VC mapping. Prototype Inputs INT4 al3EnableTxCond(sDEV_HNDL devId, sAL3_QID queId) devId: device Handle (from al3Add) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 77 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface queId: specifies the queue handle for the channels Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Disabling Transmit Conditioning: al3DisableTxCond This function disables transmit conditioning for an existing channel(s) to VP/VC mapping. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3DisableTxCond(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) specifies the queue handle for the channels None Success = AL3_OK Failure = Enabling Receive Conditioning: al3EnableRxCond This function enables receive conditioning for an existing channel(s) to VP/VC mapping. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3EnableRxCond(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) specifies the queue handle for the channels None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 78 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Disabling Receive Conditioning: al3DisableRxCond This function disables receive conditioning for an existing channel(s) to VP/VC mapping. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3DisableRxCond(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) specifies the queue handle for the channels None Success = AL3_OK Failure = 5.10 SRTS Functions Enabling SRTS: al3EnableSRTS This function enables SRTS for the given T1 or E1 line. SRTS can only be enabled if the line is in UDF mode. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3EnableSRTS(sDEV_HNDL devId, UINT2 linkNum) devId: linkNum: device Handle (from al3Add) A1SP, Line numbers None Success = AL3_OK Failure = Disabling SRTS: al3DisableSRTS This function disables SRTS for the given T1 or E1 line. Prototype Inputs Outputs Returns INT4 al3DisableSRTS(sDEV_HNDL devId, UINT2 linkNum) devId: linkNum: device Handle (from al3Add) A1SP, Line numbers None Success = AL3_OK Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 79 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Failure = 5.11 Loopback Functions Enabling Loopbacks: al3EnableLpbk This function enables loopback for the specified AAL1 channel Q. The loopback is performed before the AAL1 cells that are coming from the Line Interface reach the UTOPIA interface. Prototype Inputs INT4 al3EnableLpbk(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) AAL1 channel queue Handle (from al3ActivateChannel) Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Disabling Loopbacks: al3DisableLpbk This function disables loopback for the specified AAL1 channel Q. The loopback is performed before the AAL1 cells that are coming from the Line Interface reach the UTOPIA interface. Prototype Inputs INT4 al3DisableLpbk(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) AAL1 channel queue Handle (from al3ActivateChannel) Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 80 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Enabling Utopia Loopbacks: al3UtopiaLpbkEnable This function enables a loopback at the Utopia interface. Prototype Inputs INT4 al3UtopiaLpbkEnable (sDEV_HNDL devId, BOOLEAN vciMode, UINT2 lpbkVci) devId: vciMode: lpbkVci: device Handle (from al3Add) flag that enables VCI checking vci of the looped data Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Disabling Utopia Loopbacks: al3UtopiaLpbkDisable This function disables a loopback at the Utopia interface. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3UtopiaLpbkDisable (sDEV_HNDL devId) devId: device Handle (from al3Add) None Success = AL3_OK Failure = 5.12 Idle Detection Functions Setting Activate Timeslots: al3SetTimeslotActive This function uses with processor-based Idle Channel Detection. This function sets a timeslot as active. Prototype Inputs INT4 al3SetTimeslotActive(sDEV_HNDL devId, UINT2 linkNum, UINT2 timeSlot) devId: linkNum: device Handle (from al3Add) specifies the line number to set Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 81 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface timeSlot: specifies the timeslot to set Active Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Setting Idle Timeslots: al3SetTimeslotIdle This function uses processor-based Idle Channel Detection. This function sets a timeslot as idle. Prototype Inputs INT4 al3SetTimeslotIdle(sDEV_HNDL devId, UINT2 linkNum, UINT2 timeSlot) devId: linkNum: timeSlot: device Handle (from al3Add) specifies the line number to set specifies the timeslot to set Idle Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = 5.13 OAM Functions Transmitting OAM Cells: al3TxOAMcell This function transmits an OAM cell. Prototype Inputs INT4 al3TxOAMcell(sDEV_HNDL devId, void *pOAMCell, BOOLEAN crcON) devId: pOAMCell: crcOn: device Handle (from al3Add) (pointer to) the OAM Cell to send flag to indicate if CRC Check should be run Outputs Returns Valid States None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 82 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Side Effects None Receiving OAM Cells: al3RxOAMcell This function receives an OAM cell by placing it in a buffer. Typically called by the ISR or the DPR. Prototype Inputs INT4 al3RxOAMcell(sDEV_HNDL devId, void *pOAMCell, BOOLEAN *pCRCPass) devId: pOAMCell: pCRCPass: device Handle (from al3Add) (pointer to) space to hold the OAM Cell (pointer to) the variable indicating CRC Passed Outputs Returns Valid States Side Effects the Cell contents via pOAMCell the state of the CRC check via pCRCPass Success = AL3_OK Failure = 5.14 Alarms and Statistics Enabling DS3 AIS Cells: al3EnableDS3AISCells This function enables DS3 AIS cells to be sent on a particular high-speed line. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3EnableDS3AISCells(sDEV_HNDL deviceHandle, UINT2 lineNo) devId: lineNum: device Handle (from al3Add) LINE number (0, 16) (Line 16 only for AAL1GATOR-32) None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 83 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Disabling DS3 AIS Cells: al3DisableDS3AISCells This function disables DS3 AIS cells being sent on a particular high-speed line. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3DisableDS3AISCells(sDEV_HNDL devId, UINT2 lineNum) devId: lineNum: device Handle (from al3Add) LINE number (0, 16) (Line 16 only for AAL1GATOR-32) None Success = AL3_OK Failure = Enabling SBI Alarms: al3EnableSBIAlarm This function enables alarm generation in a tributary on the SBI bus. Note: This function is not supported by the AAL1gator-4 or AAL1gator-8. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3EnableSBIAlarm(sDEV_HNDL devId, UINT2 lineNum) devId: lineNum: device Handle (from al3Add) LINE number (0-31) None Success = AL3_OK Failure = Disabling SBI Alarms: al3DisableSBIAlarm This function disables alarm generation in a tributary on the SBI bus. Note: This function is not supported by the AAL1gator-8 or AAL1gator-4. Prototype Inputs Outputs Returns INT4 al3DisableSBIAlarm(sDEV_HNDL devId, UINT2 lineNum) devId: lineNum: device Handle (from al3Add) LINE number (0-31) None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 84 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None Returning Conditional Cell Count: al3GetTCondCellCount This function returns the Tx Conditioned Cell count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetTCondCellCount (sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Suppressed Cell Count: al3GetTSupprCellCount This function returns the Tx Suppressed Cell count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetTSupprCellCount (sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Tx Cell Count: al3GetTCellCount This function returns the Tx Cell count for the specified device and queue. Prototype Inputs Outputs Returns Valid States UINT4 al3GetTCellCount(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 85 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Side Effects None Returning Rx OAM Cell Count: al3GetROAMCellCount This function returns the Rx OAM Cell count for the specified device. Prototype Inputs UINT4 al3GetROAMCellCount (sDEV_HNDL devId , UINT2 lineNum) devId: lineNum: device Handle (from al3Add) LINE number (0,8,16,24 for AAL1GATOR-32) (0 for AAL1GATOR-8/4) Outputs Returns Valid States Side Effects None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Tx OAM Cell Count: al3GetTOAMCellCount This function retrieves the Tx OAM Cell count for the specified device. Prototype Inputs UINT4 al3GetTOAMCellCount (sDEV_HNDL devId, UINT2 lineNum) devId: lineNum: device Handle (from al3Add) LINE number (0,8,16,24 for AAL1GATOR-32) (0 for AAL1GATOR-8/4) Outputs Returns Valid States Side Effects None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Dropped Rx OAM Cell Count: al3GetRDroppedOAMCellCount This function returns the Dropped Rx OAM Cell count for the specified device. Prototype Inputs UINT4 al3GetRDroppedOAMCellCount (sDEV_HNDL devId, UINT2 lineNum) devId: lineNum: device Handle (from al3Add) LINE number (0,8,16,24 for AAL1GATOR-32) (0 for AAL1GATOR-8/4) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 86 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Outputs Returns Valid States Side Effects None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning SN Error Count: al3GetRIncorrectSn This function returns the Rx Cells with SN errors for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRIncorrectSn(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Rx Cell Count With Incorrect SNP: al3GetRIncorrectSnp This function returns the Rx Cell Count with the incorrect SNP, for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRIncorrectSnp(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Cell Count: al3GetRCellCount This function returns the Rx Cell count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRCellCount(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 87 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Returning Dropped Rx Cell Count: al3GetRDroppedCellCount This function returns the Dropped Rx Cells count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRDroppedCellCount(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Rx Underrun Count: al3GetRecvUnderrun This function returns the Receiver Underrun count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRecvUnderrun(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Rx Overrun Count: al3GetRecvOverrun This function returns the Receiver Overrun count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRecvOverrun (sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Rx Pointer Reframe Count: al3GetRPtrReframeCount This function returns the Rx Pointer Reframe count for the specified device and queue. Prototype UINT4 al3GetRPtrReframeCount(sDEV_HNDL devId, sAL3_QID queId) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 88 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Inputs Outputs Returns Valid States Side Effects devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Rx Pointer Parity Error Count: al3GetRPtrParErrorCount This function returns the Rx Pointer Parity Error count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRPtrParErrorCount(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Lost Cell Count: al3GetRLostCellCount This function returns the Lost Cell count for the specified device and queue. Prototype Inputs Outputs Returns Valid States Side Effects UINT4 al3GetRLostCellCount(sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Misinserted Cell Count: al3GetRMisInsertedCellCount This function returns the Misinserted Cell count for the specified device and queue. Prototype Inputs UINT4 al3GetRMisInsertedCellCount (sDEV_HNDL devId, sAL3_QID queId) devId: queId: device Handle (from al3Add) QUEUE Handle Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 89 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Outputs Returns Valid States Side Effects None The current counter value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None Returning Sticky Bits: al3GetStickyBits This function returns the Sticky Bit Word for the specified device and queue. Note: Sticky Bits automatically clear after they have been read. Prototype Inputs UINT4 al3GetStickyBits (sDEV_HNDL devId, sAL3_QID queId, sAL3_STICKY *pSticky) devId: queId: pSticky: device Handle (from al3Add) QUEUE Handle (pointer to) space to return the Sticky Bits Outputs Returns Valid States Side Effects None The current data value extended to 32 bits (MOD_READY) ACTIVE INACTIVE None 5.15 UTOPIA Bus Configuration Functions Configuring Utopia Bus: al3UtopiaConfig This function configures the device's UTOPIA/Any-PHY bus. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3UtopiaConfig(sDEV_HNDL devId, sAL3_DIV_UTOPIA *pParms) devId: pParms: device Handle (from al3Add) (pointer to) utopia parameters structure None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 90 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.16 RAM Interface Configuration Functions Configuring RAM Interface: al3RamConfig This function configures the device's two SRAM interfaces. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3RamConfig(sDEV_HNDL devId, sAL3_DIV_RAM *pParms) devId: pParms: device Handle (from al3Add) points to RAM config params None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 91 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.17 SBI Bus Configuration Functions Configuring SBI Bus: al3SBIConfig This function configures the device's SBI bus. Note: This function is not supported by the AAL1gator-8 or AAL1gator-4. Prototype Inputs Outputs Returns Valid States Side Effects INT4 al3SBIConfig(sDEV_HNDL devId, sAL3_DIV_SBI *pParms) devId: pParms: device Handle (from al3Add) points to SBI bus config params None Success = AL3_OK Failure = Configuring SBI Bus Tributarys: al3SBITribConfig This function configures a tributary on the SBI bus. Note: The AAL1gator-4 or AAL1gator-8 does not support this function. Prototype Inputs INT4 al3SBITribConfig(sDEV_HNDL devId, UINT2 speNum, UINT2 tribNum, sAL3_DIV_TRIB *pParms) devId: speNum: tribNum: pParms: device Handle (from al3Add) SPE number (1-3) Tributary number (1-28) (pointer to) TRIB parameters structure Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 92 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.18 Direct Line Configuration Functions Configuring Direct Lines: al3DirectConfig This function configures the device's direct low speed (T1/E1) line interface. Prototype Inputs INT4 al3DirectConfig(sDEV_HNDL devId, UINT2 linkNum, sAL3_DIV_DIRECT *pParms) devId: linkNum: pParms: device Handle (from al3Add) Link Number (0-15 for AAL1GATOR-32) (0-7 for AAL1GATOR-8) (0-3 for AAL1GATOR-4) (pointer to) direct parameters structure Outputs Returns Valid States Side Effects None Success = AL3_OK Failure = 5.19 Interrupt Service Functions Getting ISR Mask Registers: al3GetMask This function returns the contents of the interrupt mask registers of the AAL1gator-32 device. Prototype Inputs Outputs Returns INT4 al3GetMask(sDEV_HNDL devId, sAL3_MASK *pMASK) devId: pMASK: device Handle (from al3Add) (pointer to) mask structure None Success = AL3_OK Failure = Valid States Side Effects INACTIVE, ACTIVE None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 93 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Setting ISR Mask Registers: al3SetMask This function sets the contents of the interrupt mask registers of the AAL1gator-32 device. Prototype Inputs INT4 al3SetMask(sDEV_HNDL devId, sAL3_MASK *pMASK) devId: pMASK: device Handle (from al3Add) (pointer to) mask structure Outputs Returns None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None Clearing ISR Mask Registers: al3ClearMask This function clears individual interrupt bits and registers in the AAL1gator-32 device. Any bits that are set in the passed structure clear in the associated AAL1gator-32 registers. Prototype Inputs Outputs Returns INT4 al3ClearMask(sDEV_HNDL devId, sAL3_MASK *pMASK) devId: pMASK: device Handle (from al3Add) (pointer to) mask structure None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None Polling ISR Registers: al3Poll This function commands the Driver to poll the interrupt registers in the Device. The call will fail unless the device is initialized into polling mode. The output of the poll is the same as when interrupts are enabled: the data gathered passes to the DPR for disposition. Prototype Inputs INT4 al3Poll (sDEV_HNDL devId, void *pBuf) devId: device Handle (from al3Add) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 94 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface pBuf: (pointer to) a preallocated ISV Outputs Returns None SUCCESS -> AL3_OK FAILURE -> Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None ISR Config: al3ISRConfig This function configures the driver to be in either polled or interrupt mode. Prototype Inputs INT4 al3ISRConfig(sDEV_HNDL devId, AL3_ISR_MODE mode) devId: mode: device Handle (from al3Add) polled or interrupt mode (AL3_ISR_MANUAL, AL3_ISR_HDWR) Outputs Returns None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) PRESENT ACTIVE INACTIVE None Reading Interrupt Status Registers: al3ISR This function reads the state of the interrupt registers in the AAL1gator-32 and stores them into an ISV. Performs functions needed to clear the interrupt, from simply clearing bits to complex functions. It then sends this ISV via a message queue or other USER defined method to the DPR task. This routine is called by the application code, from within al3ISRHandler. Prototype Inputs Outputs Returns Valid States void *al3ISR (sDEV_HNDL devId, void *pBuf) devId: pBuf: device Handle (from al3Add) (pointer to) a preallocated ISV ISR state via 'pBuf' pBuf (MOD_READY) ACTIVE INACTIVE Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 95 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Side Effects None Device Processing Routine: al3DPR This function acts on data contained in an ISV, creates a DPV, invoking application code callbacks (if defined and enabled) and possibly performing linked actions. The al3DPR calls from within the application function al3DPRTask. Prototype Inputs Outputs Returns sAL3_DPV *al3DPR(void *pBuf) pBuf: ISV buffer (from al3ISR()) None If pBuf pointed to a user allocated buffer then, a pointer to the buffer Else, a NULL pointer Valid States Side Effects (MOD_READY) PRESENT ACTIVE INACTIVE None 5.20 Counter Functions Retrieving Statistical Counts: al3GetCounter This function retrieves all the statistical counts that are kept in the Device Status Block (DSB). Prototype Inputs INT4 al3GetCounter (sDEV_HNDL devId, sAL3_CNTR_SPEC *pSpec, sAL3_DSB *pDSB, BOOLEAN update) devId: pSpec: pDSB: update: device Handle (from al3Add) (pointer to) parameter block (pointer to) space to return DSB if set, update from hardware Outputs Returns current DSB via pDSB Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 96 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Retrieving Statistical Counts: al3GetStats This function retrieves all statistical counts kept in the Device Status Block (DSB). It is the USER's responsibility to ensure that the pointer points to an area of memory large enough to hold a copy of the DSB. Prototype Inputs Outputs Returns INT4 al3GetStats (sDEV_HNDL devId, sAL3_DSB *pDSB) devId: pDSB: device Handle (from al3Add) (pointer to) device status block None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None Clearing Statistical Counts: al3ClearStats This function clears the statistical counts inside the Device Status Block (DSB). Passed structure non-zero fields correspond to the cleared counters. Prototype Inputs Outputs Returns INT4 al3ClearStats (sDEV_HNDL devId, sAL3_DSB* pBuf) devId: pBuf: device Handle (from al3Add) DSB structure used as a key None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) ACTIVE INACTIVE None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 97 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface 5.21 Device Diagnostics Testing A Single Device Register: al3TestReg This function verifies the hardware access to a device register by writing and reading back values as well as detecting parity errors. Prototype Inputs Outputs Returns INT4 al3TestReg (sDEV_HNDL devId, UINT4 regNum) devId: regNum: device Handle (from al3Add) register number to test None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) PRESENT May Set / Clear any register in the Device Testing Device Registers: al3TestRegs This function verifies the hardware access to device registers by writing and reading back values as well as detecting parity errors. Prototype Inputs Outputs Returns INT4 al3TestRegs (sDEV_HNDL devId) devId: device Handle (from al3Add) None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) PRESENT May Set / Clear any register in the Device Testing Data Bus Wiring: al3TestDataBus This function tests the data bus wiring between the AAL1gator-32 CPU, and SRAMs by performing a walking 1's test on every location in the AAL1gator-32 device's memory space. Prototype INT4 al3TestDataBus(sDEV_HNDL devId, UINT4 firstAddr, UINT4 lastAddr) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 98 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Inputs devId: firstAddr: lastAddr: device Handle (from al3Add) starting Address for test ending Address for test Outputs Returns None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) PRESENT Clears RAM and any Device configuration Testing Address Bus Wiring: al3TestAddrBus This function tests the address bus wiring between the AAL1gator-32 CPU, and SRAMs by performing a walking 1's test on the relevant bits of the address and checking for aliasing. Prototype Inputs INT4 al3TestAddrBus(sDEV_HNDL devId, UINT4 firstAddr, UINT4 lastAddr, UINT2 testConst) devId: firstAddr: lastAddr: testConst: device Handle (from al3Add) first address last address data value to use for testing Outputs Returns None Success = AL3_OK Failure = Valid States Side Effects (MOD_READY) PRESENT Clears RAM and any Device configuration 5.22 Callback Functions The AAL1gator-32 driver has the capability to callback functions within the USER code when certain events occur. These events and their associated callback routine declarations are detailed below. There is no USER code action that is required by the driver for these callbacks; the USER is free to implement these callbacks in any manner or else they can be deleted from the driver. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 99 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface A1SP Callbacks: cbackA1SP This callback function is provided by the USER and is used by the DPR to report A1SP events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information. The task that receives this message can then process this information according to the system requirements. The USER should free the DSB buffer. Prototype Inputs Outputs Returns Valid States Side Effects void cbackA1SP(sAL3_DPV *pcurrDPV) pcurrDPV: pointer to current DPV received from DPR None None ACTIVE None Utopia Callbacks: cbackUtopia This callback function is provided by the USER and is used by the DPR to report UTOPIA events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information. The task that receives this message can then process this information according to the system requirements. The USER should free the DSB buffer. Prototype Inputs Outputs Returns Valid States Side Effects INT4 cbackUtopia(sAL3_DPV *pcurrDPV) pcurrDPV: pointer to current DPV received from DPR None None ACTIVE None RAM Callbacks: cbackRam This callback function is provided by the USER and is used by the DPR to report RAM events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information. The task that receives this message can then process this information according to the system requirements. The USER should free the DSB buffer. Prototype Inputs INT4 cbackRAM(sAL3_DPV *pcurrDPV) pcurrDPV: pointer to current DPV received from DPR Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 100 AAL1gator-32/-8/-4 Driver User's Manual Application Programming Interface Outputs Returns Valid States Side Effects None None ACTIVE None SBI Callbacks: cbackSBI This callback function is provided by the USER and is used by the DPR to report SBI bus events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information. The task that receives this message can then process this information according to the system requirements. The USER should free the DSB buffer. Prototype Inputs Outputs Returns Valid States Side Effects void cbackSBI(sAL3_DPV *pcurrDPV) pcurrDPV: pointer to current DPV received from DPR None None ACTIVE None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 101 AAL1gator-32/-8/-4 Driver User's Manual Hardware Interface 6 HARDWARE INTERFACE The AAL1gator-32 driver interfaces directly with the USER's hardware. In this section, a listing of each point of interface is shown, along with a declaration and any specific porting instructions. It is the responsibility of the USER to connect these requirements into the hardware, either by defining a macro or by writing a function for each item listed. Take care when matching parameters and return values. 6.1 Device I/O Safe Reading from Registers: sysAl3SafeReadReg This function reads the contents of a specific register location. This macro/function should be UINT2 oriented and should be defined by the user to reflect the target system's addressing logic. This function is expected to have error recovery since this function is used to access the device first. Prototype Inputs Outputs Returns #define sysAl3SafeReadReg(baseAddr, offset),UINT2 sysAl3SafeReadReg(UINT2 * baseAddr, UINT4 offset) baseAddr: offset: pData: base Address of the Device offset from 'baseAdd' for this read data read placed into this (pointed to) variable Success = data read Failure = Reading from Registers: sysAl3ReadReg This function reads the contents of a specific register location. This macro/function should be UINT2 oriented and should be defined by the user to reflect the target system's addressing logic. There is no need for error recovery in this function. Prototype Inputs Outputs Returns #define sysAl3ReadReg(baseAddr, offset), UINT2 sysAl3ReadReg(UINT2 * baseAddr, UINT4 offset) baseAddr: offset: base Address of the Device offset from 'baseAdd' for this read None Always = data read Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 102 AAL1gator-32/-8/-4 Driver User's Manual Hardware Interface Writing to Registers: sysAl3WriteReg This function writes the supplied value to the specific register location. This macro/function should be UINT2 oriented and should be defined by the user to reflect the target system's addressing logic. There is no need for error recovery in this function. Prototype Inputs #define sysAl3WriteReg(baseAddr, offset, data), void sysAl3WriteReg(UINT2 * baseAddr, UINT4 offset, UINT2 data) baseAddr: offset: data: base Address of the Device offset from 'baseAdd' for this read data to be written Outputs Returns None Always = data written 6.2 Interrupt Servicing This section describes the platform specific routines that are required by the AAL1gator32 driver AND provided by the USER. Details are given with each routine. Installing Handlers: sysAl3ISRHandlerInstall This function installs the USER-supplied Interrupt Service Routine (ISR), sysAl3ISRHandler, into the processor's interrupt vector table. Prototype Inputs Outputs Returns INT4 sysAl3ISRHandlerInstall(void ) None None Success = AL3_OK Failure = Invoking Handlers: sysAl3ISRHandler This function is invoked when one or more AAL1gator-32 devices raise the interrupt line to the microprocessor. This routine invokes the driver-provided routine, al3ISR, for each device registered with the driver. Prototype Inputs Outputs Returns void sysAl3ISRHandler (INT4 irq) None None Success = AL3_OK Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 103 AAL1gator-32/-8/-4 Driver User's Manual Hardware Interface Failure = Removing Handlers: sysAl3ISRHandlerRemove This function disables the Interrupt processing for this device. Removes the USERsupplied Interrupt Service routine (ISR), sysAl3ISRHandler, from the processor's interrupt vector table. Prototype Inputs Outputs Returns INT4 sysAl3ISRHandlerRemove(void) None None Success = AL3_OK Failure = Invoking DPR Routines: sysAl3DPRTask This routine is spawned as a separate task within the RTOS. It runs periodically and retrieves interrupt status information saved for it by the al3ISRHandler routine and then invokes the al3DPR routine for the appropriate device. Prototype Inputs Outputs Returns void sysAl3DPRTask (void) None None None Starting the DPR Tasks: sysAl3DPRTaskStart This routine invokes the DPR task. This routine is called in al3ModuleStart. Prototype Inputs Outputs Returns INT4 sysAl3DPRTaskStart (void *dprFuncAddr) None None Success = 0x00 Failure = non-zero Stopping the DPR Tasks: sysAl3DPRTaskStop This routine deletes the DPR task. This routine is called in al3ModuleStop. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 104 AAL1gator-32/-8/-4 Driver User's Manual Hardware Interface Prototype Inputs Outputs Returns void sysAl3DPRTaskStop (void) None None None Starting Statistics Task: sysAl3StatTask This routine is spawned as a separate task within the RTOS. It runs periodically and retrieves hardware statistics and updates software statistics in DSB accordingly. The period of this task is defined by statUpdatePeriod in the DDB. Prototype Inputs Outputs Returns void sysAl3StatTask (void) None None None Starting Statistics Task: sysAl3StatTaskStart This routine spawns the Stats task. This routine is called in al3ModuleStart. Prototype Inputs Outputs Returns INT4 sysAl3StatTaskStart (void *statFuncAddr) None None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 105 AAL1gator-32/-8/-4 Driver User's Manual Hardware Interface Stopping Statistic Updates: sysAl3StatTaskStop This routine deletes the Stats task. This routine is called in al3ModuleStop. Prototype Inputs Outputs Returns void sysAl3StatTaskStop (void) None None Success = AL3_OK Failure = Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 106 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface 7 RTOS INTERFACE The AAL1gator-32 driver requires the use of some RTOS resources. In this section, a listing of each required resource is shown, along with a declaration and any specific porting instructions. It is the responsibility of the USER to connect these requirements into the RTOS, either by defining a macro or writing a function for each item listed. Care should be taken when matching parameters and return values. 7.1 Memory Allocation/De-Allocation Allocating Memory: sysAl3MemAlloc This function allocates specified number of bytes of memory. Prototype Inputs Outputs Returns #define sysAl3MemAlloc(numBytes), UINT1 *sysAl3MemAlloc(UINT4 numBytes) numBytes: number of bytes to be allocated None Pointer to first byte of allocated memory NULL pointer (memory allocation failed) Freeing Memory: sysAl3MemFree This function frees memory allocated using sysAl3MemAlloc. Prototype Inputs Outputs Returns #define sysAl3MemFree(pFirstByte), void sysAl3MemFree(UINT1 *pFirstByte) pFirstByte: pointer to first byte of the memory region being de-allocated None None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 107 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface 7.2 Buffer Management All operating system provides some sort of buffer system, particularly for use in sending and receiving messages. The following calls, provided by the USER, allow the Driver to Get and Return buffers from the RTOS. It is the USER's responsibility to create any special resources or pools to handle buffers of these sizes during the sysAl3BufferStart call. Starting Buffers: sysAl3BufferStart This function alerts the RTOS that the time has come to make sure ISB buffers and DSB buffers are available and sized correctly. This may involve the creation of new buffer pools and it may involve nothing, depending on the RTOS. Prototype Inputs Outputs Returns #define sysAl3BufferStart() INT4 sysAl3BufferStart(void) None None AL3_OK AL3_FAIL Getting Buffers: sysAl3DPVBufferGet This function gets a buffer from the RTOS that will be used by the ISR code to create a Interrupt Service Vector (ISV). The ISV consists of data transferred from the devices interrupt status registers. Prototype Inputs Outputs Returns #define sysAl3DPVBufferGet() sAL3_ISV * sysAl3ISVBufferGet(void) None None Success = (pointer to) a ISV buffer Failure = NULL (pointer) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 108 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface Getting Buffers: sysAl3ISVBufferGet This function Gets a buffer from the RTOS that will be used by the ISR code to create a Interrupt Service Vector (ISV). The ISV consists of data transferred from the devices interrupt status registers. Prototype Inputs Outputs Returns #define sysAl3ISVBufferGet() sAL3_ISV *sysAl3ISVBufferGet(void) None None Success = (pointer to) a ISV buffer Failure = NULL (pointer) Sending Buffers: sysAl3BufferSend This function sends a buffer, through regular message channels, to the DPR task handler sysAl3DPRTask. Prototype Inputs Outputs Returns #define sysAl3BufferSend(pISV) INT4 sysAl3BufferSend (sAL3_ISV *pISV) pISV: (pointer to) buffer to send None Success = 0x00 Failure = (-1) Receiving Buffers: sysAl3BufferReceive This function receives a DPV/ISV buffer from the RTOS. Prototype Inputs Outputs Returns #define sysAl3BufferReceive () sAL3_ISV *sysAl3BufferReceive (void) None (pointer to) an ISV buffer None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 109 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface Returning Buffers: sysAl3DPVBufferRtn This function returns a DPV buffer to the RTOS when the information in the block is no longer needed by the DPR. Prototype Inputs Outputs Returns #define sysAl3DPVBufferRtn(pDPV) INT4 sysAl3DPVBufferRtn(sAL3_DPV *pdpv) pdpv: (pointer to) a DSB buffer None Success = AL3_OK Failure = AL3_FAIL Returning Buffers: sysAl3ISVBufferRtn This function returns a ISV buffer to the RTOS when the information in the block is no longer needed by the DPR. Prototype Inputs Outputs Returns #define sysAl3ISVBufferRtn(pISV) INT4 sysAl3ISVBufferRtn(sAL3_ISV *pisv) pisv: (pointer to) a ISV buffer None Success = AL3_OK Failure = AL3_FAIL Stopping Buffers: sysAl3BufferStop This function alerts the RTOS that the Driver no longer needs any of the ISV buffers or DPV buffers and that if any special resources were created to handle these buffers, they can be deleted now. Prototype Inputs Outputs Returns #define sysAl3BufferStop(} void sysAl3BufferStop (void) None None None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 110 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface 7.3 Timers Creating Timer Objects: sysAl3TimerCreate This function creates a timer object for general use. Prototype Inputs Outputs Returns #define sysAl3TimerCreate() void *sysAl3TimerCreate (void) None None Success = (pointer to) a timer object Failure = NULL (pointer) Starting Timers: sysAl3TimerStart This function starts a timer. Prototype #define sysAl3TimerStart(pTimer, period, pFunc) INT4 sysAl3TimerStart (void *ptimer, UINT4 period, void *pfunc, INT4 arg) ptimer: period: pfunc: Inputs (pointer to) timer object time (in milliseconds) function to invoke when timer expires Outputs Returns None None Aborting Timers: sysAl3TimerAbort This function aborts a running timer. Prototype Inputs Outputs Returns #define sysAl3TimerAbort(pTimer) void sysAl3TimerAbort (void *ptimer) ptimer: (pointer to) timer object None AL3_OK Deleting Timers: sysAl3TimerDelete This function deletes a timer. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 111 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface Prototype Inputs Outputs Returns #define sysAl3TimerDelete(pTimer) void sysAl3TimerDelete (void *ptimer) ptimer: (pointer to) timer object None None Suspending a Task: sysAl3TimerSleep This function suspends execution of a driver task for a specified number of milliseconds. Prototype Inputs Outputs Returns #define sysAl3TimerSleep(time) void sysAl3TimerSleep (UINT4 msec) msec: sleep time in milliseconds None None 7.4 Semaphores Creating Semaphores: sysAl3SemCreate This function creates an integer semaphore object. Prototype Inputs Outputs Returns #define sysAl3SemCreate() void *sysAl3SemCreate(void) None None Success = (pointer to) a semaphore object Failure = NULL (pointer) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 112 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface Taking Semaphores: sysAl3SemTake Takes an integer semaphore. Prototype Inputs Outputs Returns #define sysAl3SemTake(psem) void sysAl3SemTake(void *psem) psem: (pointer to) a semaphore object None AL3_SUCCESS AL3_FAILURE Giving Semaphores: sysAl3SemGive This function gives an integer semaphore. Prototype Inputs Outputs Returns #define sysAl3SemGive(psem) void sysAl3SemGive(void *psem) psem : (pointer to) a semaphore object None AL3_SUCCESS AL3_FAILURE Deleting Semaphores: sysAl3SemDelete This function deletes an integer semaphore object. Prototype Inputs Outputs Returns #define sysAl3SemDelete(psem) void sysAl3SemDelete(void *psem) psem : (pointer to) a semaphore object None AL3_SUCCESS AL3_FAILURE 7.5 Preemption Disabling Preemption: sysAl3PreemptDisable This routine prevents the calling task from being pre-empted. If the driver is in interrupt mode, this routine locks out all interrupts as well as other tasks in the system. If the driver is in polling mode, this routine locks out other tasks only. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 113 AAL1gator-32/-8/-4 Driver User's Manual RTOS Interface Prototype Inputs Outputs Returns #define sysAl3PreemptDisable () INT4 sysAl3PreemptDisable(void) None None Pre-emption key (passed back as an argument in sysAl3PreemptEn) Disabling Preemption: sysAl3PreemptEnable This routine allows the calling task to be pre-empted. If the driver is in interrupt mode, this routine unlocks all interrupts and other tasks in the system. If the driver is in polling mode, this routine unlocks other tasks only. Prototype Inputs Outputs Returns #define sysAl3PreemptEnable (key) void sysAl3PreemptEnable(INT4 key) key - pre-emption key (returned by sysAl3PreemptEn) None None Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 114 AAL1gator-32/-8/-4 Driver User's Manual Porting Drivers 8 PORTING DRIVERS This section outlines how to port the AAL1gator-32 device driver to your hardware and RTOS platform. However, this manual can offer only guidelines for porting the AAL1gator-32 driver because each platform and application is unique. 8.1 Driver Source Files The C source files listed below contain the code for the AAL1gator-32 driver. You may need to modify the code or develop additional code. The code is in the form of constants, macros, and functions. For ease of porting, the code is grouped into source files (src) and include files (inc). The src files contain the functions and the inc files contain the constants and macros. Figure 9: Driver Source Files al3_drv src al3_api.c (contains top level API functions) al3_api2.c (contains internal (api-related) functions) al3_chan.c (channel configuration API & internal functions) al3_diag.c (diagnostic API & internal functions) al3_hw.c (hardware interface functions) al3_stat.c (alarms, counters and status API & internal functions) al3_rtos.c (RTOS interface functions) al3_init.c (initialization API & internal functions) al3_isr.c (ISR API & internal functions) al3_dpr.c (DPR API & internal functions) al3_api.h (contains data-structure definitions and prototypes) al3_hw.h (contains hardware-interface macro and constant definitions) al3_rtos.h (contains RTOS-interface macro and constant definitions) al3_stat.h (contains counter configuration structures and prototypes) al3_chan.h (contains channel configuration structures and prototypes) al3_dev.h (contains device register definitions) al3_diag.h (contains diagnostic configuration structures and prototypes) al3_mdb (contains the layout of the MDB) al3_dpr.h (contains DPR configuration structures and prototypes al3_init.h (contains initialization configuration structures and prototypes) al3_isr.h (contains ISR configuration structures and prototypes) al3_typs.h (contains general definitions for compiling) example Makefile al3_app.c (contains example code) al3_app.h (contains example code) inc 8.2 Driver Porting Procedures The following procedures summarize how to port the AAL1gator-32 driver to your platform. The subsequent sections describe these procedures in more detail. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 115 AAL1gator-32/-8/-4 Driver User's Manual Porting Drivers To port the AAL1gator-32 driver to your platform: Procedure 1: Port the driver's RTOS extensions (page 116): Procedure 2: Port the driver to your hardware platform (page 118): Procedure 3: Port the driver's application-specific elements (page 119): Procedure 4: Build the driver (page 120). Procedure 1: Porting Driver RTOS Extensions The RTOS extensions encapsulate all RTOS specific services and data types used by the driver. The al3_typs.h file contains data types and compiler-specific data-type definitions. The al3_rtos.h & al3_rtos.c files contain macros and functions for RTOS specific services used by the Driver. These RTOS services include: * * * * * Memory Management Buffer Management Timers Task Management Semaphores To port the driver's OS extensions: 1. Modify the data types in al3_typs.h. The number after the type identifies the data-type size. For example, UINT4 defines a 4-byte (32-bit) unsigned integer. Substitute the compiler types that yield the desired types as defined in this file. 2. Modify the RTOS specific macros in al3_rtos.h and/or the RTOS specific functions in al3_rtos.c. The flag `USE_RTOS_MACROS' (in al3_rtos.h) enables the macros in al3_rtos.h and disables the functions in al3_rtos.c. By default this flag is set. Clear this flag if you prefer to use the functions instead of macros. The following table outlines the macros/functions that need to be defined/coded: Service Type Macro Name sysAl3MemAlloc sysAl3MemFree sysAl3MemCopy sysAl3MemCopy sysAl3BufferStart Description Memory Allocates a memory block Frees a memory block Sets a memory block to one value Copies a memory block Allows the Application to pre-setup buffer pools for both ISV and DPV buffers Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 116 AAL1gator-32/-8/-4 Driver User's Manual Porting Drivers Service Type Macro Name sysAl3DPVBufferGet sysAl3ISVBufferGet sysAl3BufferSend Description Returns a DPV Buffer to the driver from the Application's buffer pool Returns a ISV Buffer to the driver from the Application's buffer pool Allows the Application to choose the method for sending each initialized ISV from the ISR code to the DPR Task Allows the Application to choose the method for receiving each initialized ISV from the ISR code to the DPR Task Returns a DPV to the Application's DPV pool Returns a ISV to the Application's ISV pool Allows the Application to clean-up and/or deallocate both the DPV and ISV buffer pools Creates a new Timer for use by the driver Starts a timer Aborts a timer Deletes a timer Causes a timer to trigger after a specified period of time sysAl3BufferReceive sysAl3DPVBufferRtn sysAl3ISVBufferRtn sysAl3BufferStop Timer sysAl3TimerCreate sysAl3TimerStart sysAl3TimerAbort sysAl3TimerDelete sysAl3TimerSleep Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 117 AAL1gator-32/-8/-4 Driver User's Manual Porting Drivers Service Type Macro Name sysAl3DPRTaskStart Description DPR / Statistics Management Allows the Application to install/start the DPR task Allows the Application to control the DPR Task Allows the Application to deinstall/stop the DPR Task Allows the Application to install/start the STAT task Allows the Application to control the STAT Task Allows the Application to deinstall/stop the STAT Task Create an integer semaphore Sets an integer semaphore Clears an integer semaphore Deletes an integer semaphore sysAl3DPRTask sysAl3DPRTaskStop sysAl3StatTaskStart sysAl3StatTask sysAl3StatTaskStop Semaphore sysAl3SemCreate sysAl3SemTake sysAl3SemGive sysAl3SemDelete Procedure 2: Porting Drivers to Hardware Platforms This section describes how to modify the AAL1gator-32 driver for your hardware platform. To port the driver to your hardware platform: 1. Define the Hardware system-configuration constants in the al3_hw.h file. Modify the following constants to reflect your system's hardware configuration: Device Constant AL3_SHIFT Description Default Adjusts the al3ReadXXX and al3WriteXXX macros for address bus width 1 2. Modify the Hardware specific macros in al3_hw.h and/or the Hardware specific functions in al3_hw.c. The flag `USE_HW_MACROS' (in al3_hw.h) enables the macros in al3_hw.h and disables the functions in al3_hw.c. By default this flag is set. Clear this flag if you prefer to use the functions instead of the macros. The following table outlines the macros/functions that need to be defined/coded: Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 118 AAL1gator-32/-8/-4 Driver User's Manual Porting Drivers Service Type Macro Name sysAl3SafeReadReg sysAl3ReadReg sysAl3WriteReg Description Read/Write Create an integer semaphore Sets an integer semaphore Clears an integer semaphore Installs the ISR Handler Services each ISR Removes the ISR Handler ISR sysAl3ISRHandlerInstall sysAl3ISRHandler sysAl3ISRHandlerRemove Procedure 3: Porting Driver Application-Specific Elements Application specific elements are configuration constants and callback functions used by the API for developing an application. This section describes how to modify the application specific elements in the AAL1gator-32 driver. To port the driver's application-specific elements: 1. Define the following driver task-related callback functions. Each function can be defined for the Driver by passing its address via an initialization profile. The use of each callback is optional. Passing a NULL in place of the function's address disables the Driver's use of that function. The following table lists the callbacks that may be used by the application: CallBack Function sysAl3CbackRAM sysAl3CbackSBI sysAl3CbackA1SP sysAl3CbackUtopia Description Handles events that relate to the RAM section of the Device Handles events that relate to the SBI section of the Device Handles events that relate to the A1SP section of the Device Handles events that relate to the Utopia Bus section of the Device Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 119 AAL1gator-32/-8/-4 Driver User's Manual Porting Drivers Procedure 4: Building Drivers This section describes how to build the AAL1gator-32 driver. To build the driver: 2. Ensure that the directory variable names in the makefile reflect your actual driver and directory names. 3. Compile the source files and build the AAL1gator-32 API driver library using your make utility. 4. Link the AAL1gator-32 API driver library to your application code. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 120 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions APPENDIX A: CODING CONVENTIONS This section describes the coding conventions used in the implementation of all PMC driver software. Variable Type Definitions Table 37: Variable Type Definitions Type UINT1 UINT2 UINT4 INT1 INT2 INT4 BOOLEAN VOID Description unsigned integer - 1 byte unsigned integer - 2 bytes unsigned integer - 4 bytes signed integer - 1 byte signed integer - 2 bytes signed integer - 4 bytes unsigned integer - 2 bytes void Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 121 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions Naming Conventions Table 38 presents a summary of the naming conventions followed by all PMC driver software. A detailed description follows the sub-sections. The names used in the drivers are verbose enough to make their purpose fairly clear. This makes the code more readable. Generally, the device's name or abbreviation appears in prefix. Table 38: Naming Conventions Type Macros Constants Structures API Functions Porting Functions Static Functions Variables Pointers to variables Global variables Case Uppercase Uppercase Hungarian Notation Hungarian Notation Hungarian Notation Hungarian Notation Hungarian Notation Hungarian Notation Hungarian Notation prefix variable name with "p" prefix with device name Naming convention Examples prefix with "m" and mAL3_WRITE device abbreviation prefix with device abbreviation AL3_REG prefix with "s" and sAL3_DDB device abbreviation prefix with device name prefix with "sys" and device name al3Add sysAl3RawRead() MyStaticFunction() maxDevs pmaxDevs al3Mdb Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 122 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions Macros The following list identifies the macros conventions used in the driver code: * * * * Macro names must be all uppercase. Words shall be separated by an underscore. The letter "m" in lowercase is used as a prefix to specify that it is a macro, then the device abbreviation must appear. Example: mAL3_WRITE is a valid name for a macro. Constants The following list identifies the constants conventions used in the driver code: * * * * Constant names must be all uppercase. Words shall be separated by an underscore. The device abbreviation must appear as a prefix. Example: AL3_REG is a valid name for a constant. Structures The following list identifies the macros conventions used in the driver code: * * * * Structure names must be all uppercase. Words shall be separated by an underscore. The letter "s" in lowercase must be used as a prefix to specify that it is a structure, then the device abbreviation must appear. Example: sAL3_DDB is a valid name for a structure. Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 123 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions Functions API Functions * * * Naming of the API functions must follow the hungarian notation. The device's full name in all lowercase shall be used as a prefix. Example: al3Add() is a valid name for an API function. Porting Functions * * * * * * * * Porting functions correspond to all function that are hardware and/or RTOS dependant. Naming of the porting functions must follow the hungarian notation. The "sys" prefix shall be used to indicate a porting function. The device's name starting with an uppercase must follow the prefix. Example: sysAl3RawRead() is a hardware/RTOS specific. Static Functions Static Functions are internal functions and have no special naming convention. However, they must follow the hungarian notation. Example: myDummyFunction() is a valid name for an internal function. Variables * * Naming of variables must follow the hungarian notation. A pointer to a variable shall use "p" as a prefix followed by the variable name unchanged. If the variable name already starts with a "p", the first letter of the variable name may be capitalized, but this is not a requirement. Double pointers might be prefixed with "pp", but this is not required. Global variables must be identified with the device's name in all lowercase as a prefix. Examples: maxDevs is a valid name for a variable, pmaxDevs is a valid name for a pointer to maxDevs, and al3BaseAddress is a valid name for a global variable. Note: Both pprevBuf and pPrevBuf are accepted names for a pointer to the prevBuf variable, and that both pmatrix and ppmatrix are accepted names for a double pointer to the variable matrix. * * * Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 124 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions File Organization Table 39 presents a summary of the file naming conventions. All file names must start with the device abbreviation, followed by an underscore and the actual file name. File names should convey their purpose with a minimum amount of characters. If a file size is getting too big one might separate it into two or more files, providing that a number is added at the end of the file name (e.g. al3_api.c or al3_api2.c). There are 5 different types of files: * * * * * The Generic API files containing all the generic API functions (al3ModuleOpen, al3Add, al3Activate, etc..) Device Specific API files containing device specific API functions (Initialization, Stats, etc...) The hardware file containing the hardware dependent functions The RTOS file containing the RTOS dependent functions The other files containing all the remaining functions of the driver Table 39: File Naming Conventions File Type File Name al3_api.c, al3_api.h al3_dpr.c, al3_isr.c, al3_diag.c, al3_init.c, al3_chan.c, al3_stat.c, al3_dpr,h, al3_isr.h, al3_diag.h, al3_init.h, al3_chan.h, al3_stat.h al3_hw.c, al3_hw.h al3_rtos.c, al3_rtos.h al3_dev.h, al3_mdb.h Generic API Device Specific API Hardware Dependent RTOS Dependent Other Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 125 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions Generic API Files * The name of the Generic API files must start with the device abbreviation followed by an underscore and "api". Eventually a number might be added at the end of the name. Examples: al3_api.c is the only valid name for the file that contains the generic API functions. al3_api.h is the only valid name for the file that contains all of the generic API functions headers. * Device Specific API Files * The name of the Device Specific API files must start with the device abbreviation followed by an underscore and a descriptive ending that relates to the functionality within. Examples: al3_chan.c is the name for the file that contains API and internal functions for configuring Channels in the device. al3chan.h is the name of the file that contains the constants and declarations for the channel configuration functions. * Hardware Dependent Files * The name of the hardware dependent files must start with the device abbreviation followed by an underscore and "hw". Eventually a number might be added at the end of the file name. Examples: al3_hw.c is the only valid name for the file that contains all of the hardware dependent functions. al3_hw.h is the only valid name for the file that contains all of the hardware dependent functions headers. * RTOS Dependent Files * The name of the RTOS dependent files must start with the device abbreviation followed by an underscore and "rtos". Eventually a number might be added at the end of the file name. Examples: al3_rtos.c is the only valid name for the file that contains all of the RTOS dependent functions, al3_rtos.h is the only valid name for the file that contains all of the RTOS dependent functions headers. * Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 126 AAL1gator-32/-8/-4 Driver User's Manual Appendix A: Coding Conventions Other Driver Files * The name of the remaining driver files must start with the device abbreviation followed by an underscore and the file name itself, which should convey the purpose of the functions within that file with a minimum amount of characters. Examples: al3_dev.h is a valid name for a file that would deal with register map within the Device and al3_mdb.h is a valid name for a file that lays out the structure of the MDB. * Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 127 AAL1gator-32/-8/-4 Driver User's Manual Appendix B: Error Codes APPENDIX B: ERROR CODES The following describes the error codes used in the AAL1gator-32 device driver: Error Code AL3_OK AL3_FAIL AL3_ERR_HW AL3_ERR_SEM AL3_ERR_FREE AL3_ERR_READ AL3_ERR_RTOS AL3_ERR_ALLOC AL3_ERR_TIMER AL3_ERR_WRITE AL3_ERR_BUFFER AL3_ERR_OPEN AL3_ERR_STOP AL3_ERR_CLOSE AL3_ERR_START AL3_ERR_ISOPEN AL3_ERR_STOPED AL3_ERR_CLOSED AL3_ERR_ADD AL3_ERR_INIT AL3_ERR_RESET AL3_ERR_DELETE AL3_ERR_UPDATE AL3_ERR_ACTIVATE AL3_ERR_DEACTIVATE AL3_ERR_ISIDLE AL3_ERR_ISREADY AL3_ERR_ISSTART AL3_ERR_ISACTIVE Description Success Failure Memory allocation failure Timer management error Buffer management error Internal call to ModuleOpen failed Internal call to ModuleStop failed Internal call to ModuleClose failed Internal call to ModuleStart failed Module is already open Module is currently closed Module is currently stoped Internal call to Add failed Internal call to Init failed Internal call to Reset failed Internal call to Delete failed Internal call to Update failed Internal call to Activate failed Internal call to DeActivate failed Module is already in the IDLE state Module is already in the READY state Module is already in the START state Device is already in the ACTIVE state Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 128 AAL1gator-32/-8/-4 Driver User's Manual Appendix B: Error Codes Error Code AL3_ERR_ISPRESENT AL3_ERR_ISINACTIVE AL3_ERR_NOTIDLE AL3_ERR_NOTREADY AL3_ERR_NOTSTART AL3_ERR_NOTACTIVE AL3_ERR_NOTPRESENT AL3_ERR_NOTINACTIVE AL3_ERR_ARG AL3_ERR_CFG AL3_ERR_MDB AL3_ERR_ADDR AL3_ERR_HNDL AL3_ERR_MODE AL3_ERR_RANGE AL3_ERR_HWFAIL AL3_ERR_RAMFAIL AL3_ERR_TIMEOUT AL3_ERR_INUSE AL3_ERR_MAXPROF AL3_ERR_MAXDEVICE AL3_ERR_ARRAY_FULL AL3_ERR_CHAN_INUSE AL3_ERR_DEV_EXISTS AL3_ERR_QUEUE_INUSE Description Device is already in the PRESENT state Device is already in the INACTIVE state Module not in the IDLE state Module not in the READY state Module not in the START state Device not in the ACTIVE state Device not in the PRESENT state Device not in the INACTIVE state Invalid argument Invalid configuration Module is invalid Invalid address Invalid device handle Invalid mode Incorrect range Hardware failure RAM failure Timed out while polling Already in use Maximum profile already added Maximum device already reached Array is full Chain already in use Device already exists Queue already in use Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 129 AAL1gator-32/-8/-4 Driver User's Manual Appendix C: AAL1gator-32 Events APPENDIX C: AAL1GATOR-32 EVENTS This appendix describes the events used in the AAL1gator-32 device driver: SBI Alarm Events Event Code AL3_SBI_ALARMH_EVENT Description SBI alarm state has changed for a high link SBI alarm state has changed for a low link AL3_SBI_ALARML_EVENT SBI Extract Events Event Code AL3_EXT_INS_DC_EVENT AL3_EXT_C1FP_EVENT AL3_EXT_SYNC_EVENT Description Depth Check error has been detected C1FP realignment has been detected SBIIP_SYNC realignment has been detected FIFO underrun has been detected FIFO overrun has been detected SBI parity error has been detected AL3_EXT_FIFO_UDR_EVENT AL3_EXT_FIFO_OVR_EVENT AL3_EXT_SBI_PERR_EVENT SBI Insert Events Event Code AL3_INS_INS_DC_EVENT AL3_INS_C1FP_EVENT AL3_INS_SYNC_EVENT Description Depth Check error has been detected C1FP realignment has been detected SBIIP_SYNC realignment has been detected FIFO underrun has been detected FIFO overrun has been detected AL3_INS_FIFO_UDR_EVENT AL3_INS_FIFO_OVR_EVENT Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 130 AAL1gator-32/-8/-4 Driver User's Manual Appendix C: AAL1gator-32 Events UTOPIA Events Event Code AL3_UTOPIA_RX_RUNT_EVENT Description A short cell (less than 53 bytes) has been received UTOPIA Loopback FIFO is full Transmit UTOPIA interface has been requested to send a cell when it did not have one available Transmit UTOPIA FIFO is full Parity error encoutered in the UTOPIA interface AL3_UTOPIA_LFIFO_FULL_EVENT AL3_UTOPIA_TXFR_ERR_EVENT AL3_UTOPIA_TFIFO_FULL_EVENT AL3_UTOPIA_PAR_ERR_EVENT RAM Parity Events Event Code AL3_RAM1_PAR_ERR_EVENT Description Parity error encoutered in the RAM1 interface Parity error encoutered in the RAM2 interface AL3_RAM2_PAR_ERR_EVENT A1SP Events Event Code AL3_A1SP_TFIFO_FULL_EVENT AL3_A1SP_RFIFO_FULL_EVENT AL3_A1SP_RFIFO_EMPB_EVENT AL3_A1SP_IFIFO_FULL_EVENT AL3_A1SP_IFIFO_EMPB_EVENT AL3_A1SP_OAM_EVENT Description TALP FIFO is full Receive Status FIFO is full Receive Status FIFO is empty Transmit Idle State FIFO is full Transmit Idle State FIFO is empty A1SP block has received a new OAM cell Frame advance FIFO is full Receive line has entereed a resync state AL3_A1SP_FFIFO_FULL_EVENT AL3_RFIFO_R_LINE_RESYNC_EVENT Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 131 AAL1gator-32/-8/-4 Driver User's Manual Appendix C: AAL1gator-32 Events Event Code AL3_RFIFO_T_LINE_RESYNC_EVENT AL3_RFIFO_BITMASK_CHANGE_EVENT AL3_RFIFO_EXIT_UNDERRUN_EVENT AL3_RFIFO_ENTER_UNDERRUN_EVENT AL3_RFIFO_RECEIVE_QUEUE_ERR_EVENT Description Transmit line has entereed a resync state Bitmask for active channels has changed Queue just exited the underrun state Queue just entered the underrun state Error or status condition occurred on the receive queue (check sticky bit) Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 132 AAL1gator-32/-8/-4 Driver User's Manual Acronyms ACRONYMS AAL: ATM Adaptation Layer AAL1: ATM Adaptation Layer 1 API: Application Programming Interface BERT: Bit error-rate test BOOL: Boolean data type CBR: Constant Bit Rate CES: Circuit Emulation Service DDB: Device Data Block DIV: Device Initialization Vector DPR: Deferred Processing Routine DSB: DEVICE Status Block FCS: Frame check sequence FIFO: First in, first out GDD: Global driver database GPIC: PCI controller HCS: Header check sequence HDLC: High-level data link control ISR: Interrupt Service Routine MDB: Module Data Block MIV: Module Initialization Vector MSB: Module Status Block MVIP: Multi-vendor integration protocol PCI: Processor connection interface PHY: Physical layer RAPI: Receive Any-PHY packet interface Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 133 AAL1gator-32/-8/-4 Driver User's Manual Acronyms RCAS: Receive channel assignor RHDL: Receive HDLC processor RMAC: Receive memory access controller RTOS: Real-Time operating system SAR: Segmentation and Reassembly SBI Interface: Scaleable bandwidth interconnect interface SCD Interface: Serial clock and data interface TAPI: Transmit Any-PHY packet interface TCAS: Transmit channel assignor THDL: Transmit HDLC processor TMAC: Transmit memory access controller Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 134 AAL1gator-32/-8/-4 Driver User's Manual List of Terms LIST OF TERMS APPLICATION: Refers to protocol software used in a real system as well as validation software written to validate the AAL1gator-32 driver on a validation platform. API (Application Programming Interface): Describes the connection between this MODULE and the USER's Application code. INGRESS: An older term for the line side of the device. The line side usually contains the larger aggregate connections and usually connects to the WAN portion of a network. EGRESS: An older term for the system side of the device. The system side usually contains the smaller individual connections and usually connects to the LAN portion of a network ISR (Interrupt Service Routine): A common function for intercepting and servicing DEVICE events. This function is kept as short as possible because an Interrupt preempts every other function starting the moment it occurs and gives the service function the highest priority while running. Data is collected, Interrupt indicators are cleared and the function ended. DPR (Deferred Processing Routine): This function is installed as a task, at a USER configurable priority, that serves as the next logical step in Interrupt processing. Data that was collected by the ISR is analyzed and then calls are made into the Application that inform it of the events that caused the ISR in the first place. Because this function is operating at the task level, the USER can decide on its importance in the system, relative to other functions. DEVICE : ONE AAL1gator-32 Integrated Circuit. There can be many Devices, all served by this ONE Driver MODULE * DIV (DEVICE Initialization Vector): Structure passed from the API to the DEVICE during initialization; it contains parameters that identify the specific modes and arrangements of the physical DEVICE being initialized. DDB (DEVICE Data Block): Structure that holds the Configuration Data for each DEVICE. DSB (DEVICE Status Block): Structure that holds the Alarms, Status, and Statistics for each DEVICE. * * MODULE: All of the code that is part of this driver, there is only ONE instance of this MODULE connected to ONE OR MORE AAL1gator-32 chips. * MIV (MODULE Initialization Vector): Structure passed from the API to the MODULE during initialization, it contains parameters that identify the specific characteristics of the Driver MODULE being initialized. MDB (MODULE Data Block): Structure that holds the Configuration Data for this MODULE. MSB (MODULE Status Block): Structure that holds the Alarms, Status and Statistics for the MODULE * * Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 135 AAL1gator-32/-8/-4 Driver User's Manual List of Terms * RTOS (Real Time Operating System): The host for this Driver Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 136 AAL1gator-32/-8/-4 Driver User's Manual Index INDEX A AAL1 Channel Configuration, 19, 32, 39, 70 Aborting Timers sysAl3TimerAbort, 111 Activating Channels al3ActivateChannel, 71, 80, 81, 85, 86, 87, 88, 89 Activating Channels with Enhanced Parameters al3EnhancedActivateChannel, 72 Activating Devices al3Activate, 27, 45, 64, 66 Activating Structured Channels al3EnhancedActivateChannelStr, 33, 75 Activating Structured Channels al3ActivateChannelStr, 33 Activating Unstructured Channels al3ActivateChannelUnstr, 33, 73 al3EnhancedActivateChannelUnstr, 33, 74 activePageEXSBI, 57 activePageINSBI, 57 adapFiltSize, 47 Adding Devices al3Add, 26, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 124 Alarms and Statistics, 19, 36, 83 alarmSBI, 54 Allocating Memory sysAl3MemAlloc, 107, 116 allocTbl, 54 allocTblBlank, 53 API, 135 Application Programming Interface, 18, 19, 61, 133 appMDB, 56 Associating Channels al3AssociateChannel, 33, 76 autoActivate, 45, 64 autoInit, 57 autoStart, 45, 56 B baseAddr, 57, 65 Buffers, 59, 108, 109, 110 bufOK, 56 Building Drivers, 120 C Callback Functions, 99 Callbacks cbackA1SP, 57, 100 cbackRAM, 57, 100 cbackSBI, 57, 101 cbackUtopia, 57, 100 Calling a13DPR, 24, 29, 30, 31, 32 a13ISR, 23, 29, 30, 31, 32 cellRcvd, 52 cellRx, 54 Channel Conditioning, 40, 51, 77 Channel Provisioning, 17 checkParity, 50 Clearing ISR Mask Registers al3ClearMask, 94 Statistical Counts al3ClearStats, 97 clkKill, 44, 49 clkMaster, 43, 48 Closing Modules Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 137 AAL1gator-32/-8/-4 Driver User's Manual Index al3ModuleClose, 26, 61 CLP, 39, 50 Coding Conventions, 121 condMode, 40, 51 configuration CFG_CHAN_ENH, 50 cfgRam, 46 cfgSbi, 46 cfgUtopia, 46 Configuring Direct Lines al3DirectConfig, 36, 93 Ram Interface al3RamConfig, 91 al3RAMConfig, 35 SBI Bus al3SBIConfig, 35, 92 SBI Bus Tributarys al3SBITribConfig, 35, 92 Underrun Data al3SetUnderrun, 71 Utopia Bus al3UtopiaConfig, 90 Constants, 36 counter, 58 crcOn, 82 Creating Semaphores sysAl3SemCreate, 112 Creating Timer Objects sysAl3TimerCreate, 111 D Data Structures, 39 dbces, 54 dbcesBitMaskErr, 52 DDB, 135 ddbAddr, 56 Deactivating Channels al3DeactivateChannel, 33, 72 Deactivating Devices al3DeActivate, 27, 66 Deactivating Structured Channels al3DeactivateChannelStr, 76 Deactivating Unstructured Channels al3DeActivateChannelUnstr, 74 Deferred Processing Routine Module, 24 Deferred Processing Vector, 60 Deleting Devices al3Delete, 26, 27, 61, 65 Semaphores sysAl3SemDelete, 113 Timers sysAl3TimerDelete, 112 Device Activation and De-Activation, 66 Addition and Deletion, 17, 65 Data Block, 23, 26, 37, 56, 57, 64 Data-Block Module, 23 devCntr, 58 devDSB, 58 devId, 59 devNum, 57 devState, 57 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 138 AAL1gator-32/-8/-4 Driver User's Manual Index devValid, 57 Diagnostics, 17, 98 I/O, 102 Initialization, 17, 64, 65 Management, 28 Processing Routine al3DPR, 96, 104 Reading and Writing, 67 States, 26 Status Block, 23, 58, 97 Device Configuration, 32 diagOnInit, 45, 56, 64 Direct Line Configuration, 20, 50, 93 Configuration Functions, 93 Interface Configuration, 35, 44 Interface Configuration Table, 44 Disabling DS3 AIS Cells al3DisableDS3AISCells, 36, 84 Loopbacks al3DisableLpbk, 80, 81 Receive Conditioning al3DisableRxCond, 33, 79 SBI Alarms al3DisableSBIAlarm, 36, 84 SRTS al3DisableSRTS, 79 Transmit Conditioning al3DisableTxCond, 78 Disassociating Channels With An Existing Mapping al3DisAssociateChannel, 33, 77 divAddr, 56 divNum, 57 DPR, 135 Driver API, 19 Functions and Features, 17 Hardware Interface, 21 Interfaces, 18 Library Module, 23 Porting Procedures, 115 Porting Quick Start, 16 Source Files, 115 E egress, 135 Enabling DS3 AIS Cells al3EnableDS3AISCells, 36, 83 Enabling Loopbacks al3EnableLpbk, 80, 81 Enabling Receive Conditioning al3EnableRxCond, 33, 78 Enabling SBI Alarms al3EnableSBIAlarm, 36, 84 Enabling Transmit Conditioning al3EnableTxCond, 33, 77 errDevice, 37, 57, 65 errModule, 37, 55 error codes AL3_ERR_ACTIVATE, 128 AL3_ERR_ADD, 128 AL3_ERR_ADDR, 129 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 139 AAL1gator-32/-8/-4 Driver User's Manual Index AL3_ERR_ALLOC, 128 AL3_ERR_ARG, 129 AL3_ERR_ARRAY_FULL, 129 AL3_ERR_BUFFER, 128 AL3_ERR_CFG, 129 AL3_ERR_CHAN_INUSE, 129 AL3_ERR_CLOSE, 128 AL3_ERR_CLOSED, 128 AL3_ERR_DEACTIVATE, 128 AL3_ERR_DELETE, 128 AL3_ERR_DEV_EXISTS, 129 AL3_ERR_FREE, 128 AL3_ERR_HNDL, 129 AL3_ERR_HW, 128 AL3_ERR_HWFAIL, 129 AL3_ERR_INIT, 128 AL3_ERR_INUSE, 129 AL3_ERR_ISACTIVE, 128 AL3_ERR_ISIDLE, 128 AL3_ERR_ISINACTIVE, 129 AL3_ERR_ISOPEN, 128 AL3_ERR_ISPRESENT, 129 AL3_ERR_ISREADY, 128 AL3_ERR_ISSTART, 128 AL3_ERR_MAXDEVICE, 129 AL3_ERR_MAXPROF, 129 AL3_ERR_MDB, 129 AL3_ERR_MODE, 129 AL3_ERR_NOTACTIVE, 129 AL3_ERR_NOTIDLE, 129 AL3_ERR_NOTINACTIVE, 129 AL3_ERR_NOTPRESENT, 129 AL3_ERR_NOTREADY, 129 AL3_ERR_NOTSTART, 129 AL3_ERR_OPEN, 128 AL3_ERR_QUEUE_INUSE, 129 AL3_ERR_RAMFAIL, 129 AL3_ERR_RANGE, 129 AL3_ERR_READ, 128 AL3_ERR_RESET, 128 AL3_ERR_RTOS, 128 AL3_ERR_SEM, 128 AL3_ERR_START, 128 AL3_ERR_STOP, 128 AL3_ERR_STOPED, 128 AL3_ERR_TIMEOUT, 129 AL3_ERR_TIMER, 128 AL3_ERR_UPDATE, 128 AL3_ERR_WRITE, 128 AL3_FAIL, 128 AL3_OK, 128 ERROR_CODES, 36 EXSBI, 69, 70 extBusParity, 43, 48 extClkMaster, 49 extClkMode, 49 F FIFO Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 140 AAL1gator-32/-8/-4 Driver User's Manual Index fifo, 55 fifoOvr, 54 fifoUdr, 54 lpbkFifo, 55 talpFifoFull, 54 FIFOfrmAdvFifoFull, 54 File Organization, 125 forcedUndr, 53 frameType, 47 fRedUndr, 54 Freeing Memory sysAl3MemFree, 107 insClkMaster, 49 insertCondCellData, 40, 51 insertDataMode, 40, 51 insSynchMode, 49 Installing Handlers sysAl3ISRHandlerInstall, 103 Interrupt Service Functions, 93 Vector, 59, 109 Interrupt Servicing, 17, 29 Interrupt-Service Routine Module, 23 Invoking DPR Routines sysAl3DPRTask, 109 Invoking Handlers sysAl3ISRHandler, 103, 104 ISR, 135 ISR Config al3ISRConfig, 95 ISR Handler sysAl3ISRHandler, 119 sysAl3ISRHandlerInstall, 119 sysAl3ISRHandlerRemove, 119 isrOK, 56 G genSync, 47 Getting Buffers sysAl3DPVBufferGet, 108 sysAl3ISVBufferGet, 109 Getting ISR Mask Registers al3GetMask, 93 Giving Semaphores sysAl3SemGive, 113 H Hardware Interface, 21, 102 hiResClkSynth, 46 hwFail, 57 L lgrpType, 44, 49 lineMode, 57 linkGrpCfg, 43, 49 Loopback Functions, 80 loopbk, 42, 47 lowCDV, 46 lpbkVci, 42, 47 I Idle DetEnable, 41, 52 Pattern, 41, 52 Idle Detection Functions, 81 ingress, 135 Initialization Profile, 34, 35, 41, 43, 44, 45, 46, 63 Initializing Devices al3Init, 26, 27, 45 insBusParity, 43, 48 M maintnBitInteg, 39, 50 mapEnable, 43, 48 master, 54, 59 MAX_DEVICES, 36 MAX_DEVS, 45 MAX_DIRECT, 36 MAX_LGRPS, 37, 43, 49 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 141 AAL1gator-32/-8/-4 Driver User's Manual Index MAX_LINES, 36 MAX_QUEUES, 37 MAX_SPES, 37, 43, 49 MAX_TRIBS, 37 maxBuf, 39, 50 maxDevs, 45, 56, 124 MaxDevs, 45 maxDIVs, 56 maxInitProfs, 45 maxInsert, 40, 51 MDB, 135 MDB_USER_SIZE, 37, 56 Memory sysAl3MemCopy, 116 sysAl3MemFree, 116 mfAlign, 46 MIV, 135 modeISR, 46, 57 modState, 37 Module Activation, 62 Data Block, 23, 26, 37, 55, 61 Initialization, 26, 44, 45, 61 Initialization Vector, 26, 44, 45, 61 modMSB, 56 modState, 56 Module Management, 27 moduleOK, 58 modValid, 56 semModule, 56 States, 26 Status Block, 23, 58 timerModule, 56 modValid, 37 MSB, 135 mvipMode, 44, 50 N Naming Conventions, 122, 125 nClkDivEnable, 41, 47 nClkDivFactor, 41, 47 nClkDivFactor+2, 41, 47 noStartDrop, 40, 51 numA1SP, 57 numBytes, 107 numDevs, 56 numDIRECT, 57 numDIVs, 56 numLINE, 57 numQUE, 57 O oam, 54 OAM Functions, 82 Opening Modules al3ModuleOpen, 26, 44, 45, 61, 64 overrun, 53 ovr, 55 P param, 60 parity, 54, 55 partialFillChar, 39, 50 patternMask, 41, 52 pClkParam, 71 pCRCPass, 83 pcurrDPV, 100, 101 pcurrISV, 96 pDDB, 56 pDirectParams, 93 pDIV, 56 pDPV, 110 pDPVBuffer, 96 pDSB, 97 pFirstByte, 107 pFunc, 111 PHY, 42 pISV, 109, 110 pMask, 93, 94 pmatrix, 124 pmaxDevs, 124 pMDB, 45 pMIV, 61 Polling, 31 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 142 AAL1gator-32/-8/-4 Driver User's Manual Index Polling ISR Registers al3Poll, 94 Porting Drivers, 115, 118 pParam, 70, 72, 73, 75 ppmatrix, 124 pprevBuf, 124 pProfile, 63 pRAMParams, 91 preemption, 114 Preemption Disable sysIma84PreemptDisable, 114 Enable sysIma84PreemptEnable, 114 prevBuf, 124 Processing Flows, 27 Profile Management, 63 profileNum, 63, 64 pSBIParams, 92 pSBITribParams, 92 psem, 113 pSem, 113 pTimer, 111, 112 ptrMis, 55 ptrMismatch, 53 ptrParErr, 53 ptrParity, 54 ptrRcvd, 53 ptrRule, 54 ptrRuleErr, 53 ptrRx, 54 ptrSearch, 53 ptrSrch, 54 pUtopiaParams, 90 Configuration, 20, 48 Interface Configuration, 35, 42, 91 Interface Configuration Functions, 91 Interface Configuration Table, 42 ram1, 53 ram2, 53 ramEndAddr, 57 Reading Indirect Registers al3ReadInd, 69 Registers sysAl3ReadReg, 67 Real Time Operating System, 20 Receiving Buffers sysAl3BufferReceive, 109 Receiving OAM Cells al3RxOAMcell, 83 refValEnable, 46 Removing Handlers sysAl3ISRHandlerRemove, 104 res, 55 Resetting Devices al3Reset, 27, 65 resume, 53 Retrieving Statistical Counts al3GetCounter, 96 al3GetStats, 97 Returning Buffers sysAl3DPVBufferRtn, 110 sysAl3ISVBufferRtn, 110 Cell Count al3GetRCellCount, 87 Dropped Rx Cell Count Q qHandle, 72, 74, 76, 77, 78, 79, 80, 81, 85, 87, 88, 89 R RAM Callbacks cbackRam, 100 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 143 AAL1gator-32/-8/-4 Driver User's Manual Index al3GetRDroppedCellCount, 88 Dropped Rx OAM Cell Count al3GetRDroppedOAMCellCount, 86 Lost Cell Count rxCondSig, 40, 51 rxMask, 41, 52 rxSigMode, 40, 51 rxVci, 50 rxVpi, 50 al3GetRLostCellCount, 89 Rx Cell Count With Incorrect SNP al3GetRIncorrectSnp, 87 Rx Overrun Count al3GetRecvOverrun, 88 Rx Pointer Parity Error Count al3GetRPtrParErrorCount, 89 Rx Pointer Reframe Count al3GetRPtrReframeCount, 88 Rx Underrun Count al3GetRecvUnderrun, 88 Sticky Bits al3GetStickyBits, 90 Suppressed Cell Count revision, 57 RTOS, 136 runtCell, 55 rxDroppedOAMCellCnt, 58 rxOAMCellCnt, 58 rxStatBitmask, 55 rxStatFifoFull, 54 rxStatFifoNotEmpty, 54 rxStatQueError, 55 rxStatResync, 55 rxStatUdrEnter, 55 rxStatUdrExit, 55 S sAL3_CFG_CHAN_COND, 51 sAL3_CFG_CHAN_IDET, 52 sAL3_CFG_CHAN_SNP, 51 sAL3_DIV, 41, 43, 45, 46, 47, 48, 49, 50 sAL3_DPV, 60, 96, 100, 101 sAL3_ISV, 59, 109 SBI Bus Configuration, 20, 35 Functions, 92 Tables, 43 al3GetTSupprCellCount, 85 Tx Cell Count al3GetTCellCount, 85 TX OAM Cell Count al3GetTOAMCellCount, 86 Returns rxCASPattern, 41, 52 rxClkSrc, 47 rxCondData, 40, 51 rxCondMode, 40, 51 sDEV_HNDL, 65, 66, 83 Semaphore sysAl3SemCreate, 118 sysAl3SemDelete, 118 sysAl3SemGive, 118 sysAl3SemTake, 118 Sending Buffers sysAl3BufferSend, 109 Setting Activate Timeslots Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 144 AAL1gator-32/-8/-4 Driver User's Manual Index al3SetTimeslotActive, 81 Global Clock Configuration al3GlobalClkConfig, 33, 71 Idle Timeslots al3SetTimeslotIdle, 82 ISR Mask Registers al3SetMask, 94 Line Modes al3SetLineMode, 70 sigType, 46 snCellDrop, 53, 54 snkAnyPhyMode, 42, 48 snkBusWidth, 42, 48 snkCSMode, 42, 48 snkParity, 42, 48 snkSlaveAddr, 42, 48 snkUtopMode, 42, 48 snpAlgorithm, 39, 51 speEnable, 44, 49 speSync, 44, 49 speType, 44, 49 srcAnyPhyMode, 42, 47 srcBusWidth, 42, 47 srcCSMode, 42, 48 srcParity, 42, 48 srcSlaveAddr, 42, 48 srcUtopMode, 42, 48 SRTS Functions, 79 srtsRes, 54 SRTSResume, 53 srtsUndr, 55 SRTSUndrn, 53 Starting Buffers sysAl3BufferStart, 108 Modules al3ModuleStart, 26, 45, 62, 104, 105 Starting Timers sysAl3TimerStart, 111 Statistics Collection and Status Monitoring, 17 Statistics Functions, 96 statUpdatePeriod, 57, 105 statUpdateTime, 57 Sticky Bit Error Word, 52 Stopping Buffers sysAl3BufferStop, 110 Modules al3ModuleStop, 26, 62, 104, 106 suppressSignaling, 50 Suspending a Task sysAl3TimerSleep, 112 sync, 54 syncMode, 44, 50 sysAl3BufferReceive, 117 sysAl3BufferSend, 117 sysAl3BufferStart, 116 sysAl3BufferStop, 117 sysAl3CbackA1SP, 119 sysAl3CbackRAM, 119 sysAl3CbackSBI, 119 sysAl3CbackUtopia, 119 sysAl3DPRTask, 118 sysAl3DPRTaskStart, 118 sysAl3DPRTaskStop, 118 sysAl3DPVBufferGet, 117 sysAl3DPVBufferRtn, 117 sysAl3ISVBufferGet, 117 sysAl3ISVBufferRtn, 117 sysAl3MemCopy, 116 sysAl3ReadReg, 119 sysAl3SafeReadReg, 119 sysAl3StatTask, 118 sysAl3StatTaskStart, 118 sysAl3StatTaskStop, 118 sysAl3WriteReg, 119 T t1Mode, 46 Taking Semaphores sysAl3SemTake, 113 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 145 AAL1gator-32/-8/-4 Driver User's Manual Index Testing Address Bus Wiring al3TestAddrBus, 99 Data Bus Wiring al3TestDataBus, 98 Timer sysAl3TimerAbort, 117 sysAl3TimerCreate, 117 sysAl3TimerDelete, 117 sysAl3TimerSleep, 117 sysAl3TimerStart, 117 TL_SYNC, 47 transErr, 55 transfer, 52 Transmit txCASPattern, 41, 52 txClkSrc, 47 txClp, 39, 50 txCondData, 40, 51 txCondSig, 40, 51 txGfc, 39, 50 txHec, 39, 51 txMask, 41, 52 txOAMCount, 57 txPti, 39, 50 txSuppress, 39, 50 txVci, 50 txVpi, 50 Transmitting OAM Cells al3TxOAMcell, 82 trib, 69, 70 txIdleFifoFull, 54 txIdleFifoNotEmpty, 54 txStatResync, 55 U underrun, 53 undr, 55 usrCtxt, 57 UTOPIA Bus Configuration Functions, 90 UTOPIA/Any-PHY Bus Configuration, 33 UTOPIA/AnyPhy Configuration, 20, 47 V Variable Type Definition, 121 Variables, 37 vpiModeOK, 56 vpiVciMapping, 47 W Writing to Devices al3Write, 67 to Indirect Registers al3WriteInd, 69 to Register Blocks al3WriteBlock, 68 to Registers sysAl3WriteReg, 67, 68 Proprietary and Confidential to PMC-Sierra, Inc., and for its Customers' Internal Use Document ID: PMC-1991444, Issue 3 146 |
Price & Availability of 1991444 |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |